This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Linux applications using RVDS

Note: This was originally posted on 28th July 2010 at http://forums.arm.com

hi

I  cross compiled some linux code using RVDS .

i used the instructions given in the following document

Building linux Applications using RVCT 4.0 and GNU tools

i used the latest CODE sourcery tool chain for this..


The compilation went through and it created a dynamically linked excuetable which uses shared libs.

My aim is to create a static excuetable which does not depend on any shared obj .

(basically something like gcc --static ) but i am not able to find such a option with armcc.

Kindly help

Regards
Sundar
Parents
  • Note: This was originally posted on 19th August 2010 at http://forums.arm.com

    Now i am stuck in another issue.
    I was able to build a static binary as mentioned . but now
    The binaries which i built are all seg faulting in the target.

    A statically linked binary segfaulting in the target baffles me :unsure:.

    First, it would be better to start a new thread for this question since it is about a different topic instead of mixing a new topic into this thread.  But: I don't think I can help you much.  A statically linked binary can seg fault for lots of reasons -- you'll need to debug it using something like gdb or DS-5 or just printfs.  Once you have more details (like "my app seg faults on this source line" or "in this library call" or "before it reaches main") then posting them (in a new thread) might be appropriate if you need help figuring it out.

    I have another question.

      Like you said the options in the config file are implicit options provided to the compiler. But now when i compile i give the path to the config file ( xml file) and there are some options in it which was automatically configured.

    You said it depends on the options which you give inthe comand line depending on which it will be decided that whether the options are to be taken or not.

    now armcc by default produces a static binary until u give the option --shared. Problem is my config file has this option called --shared which  is why it produces a dynamic lib. how can i tell the compiler not to take this option ? \

    If this works i need not work around using translate_gcc


    [This continues part of this thread, so I don't think a new thread is needed.]
    By "config file" I mean the file being passed to --arm_linux_config_file=...

    The config file tells armcc how gcc behaves, by default and when various options are given.  So it will encode rules like "if were compiling for C++ then use these include paths", "if we're linking for -mthumb then use these objects & libraries and library paths", and a lot of other things.  Looking at the contents of the config file is probably not that helpful since it's hard to know what parts of the file are used for a given armcc invocation.  Using '-v' (with --translate_gcc) will show the "full" command-lines.

    The --translate_gcc option is not directly related to the config file.  It tells armcc that it should interpret the other command line options as gcc options (e.g. -mthumb) instead of RVCT options (e.g. --thumb).

    Can you give an example of a command-line that you're using now that works and explain what part of it you want to change or don't like?
Reply
  • Note: This was originally posted on 19th August 2010 at http://forums.arm.com

    Now i am stuck in another issue.
    I was able to build a static binary as mentioned . but now
    The binaries which i built are all seg faulting in the target.

    A statically linked binary segfaulting in the target baffles me :unsure:.

    First, it would be better to start a new thread for this question since it is about a different topic instead of mixing a new topic into this thread.  But: I don't think I can help you much.  A statically linked binary can seg fault for lots of reasons -- you'll need to debug it using something like gdb or DS-5 or just printfs.  Once you have more details (like "my app seg faults on this source line" or "in this library call" or "before it reaches main") then posting them (in a new thread) might be appropriate if you need help figuring it out.

    I have another question.

      Like you said the options in the config file are implicit options provided to the compiler. But now when i compile i give the path to the config file ( xml file) and there are some options in it which was automatically configured.

    You said it depends on the options which you give inthe comand line depending on which it will be decided that whether the options are to be taken or not.

    now armcc by default produces a static binary until u give the option --shared. Problem is my config file has this option called --shared which  is why it produces a dynamic lib. how can i tell the compiler not to take this option ? \

    If this works i need not work around using translate_gcc


    [This continues part of this thread, so I don't think a new thread is needed.]
    By "config file" I mean the file being passed to --arm_linux_config_file=...

    The config file tells armcc how gcc behaves, by default and when various options are given.  So it will encode rules like "if were compiling for C++ then use these include paths", "if we're linking for -mthumb then use these objects & libraries and library paths", and a lot of other things.  Looking at the contents of the config file is probably not that helpful since it's hard to know what parts of the file are used for a given armcc invocation.  Using '-v' (with --translate_gcc) will show the "full" command-lines.

    The --translate_gcc option is not directly related to the config file.  It tells armcc that it should interpret the other command line options as gcc options (e.g. -mthumb) instead of RVCT options (e.g. --thumb).

    Can you give an example of a command-line that you're using now that works and explain what part of it you want to change or don't like?
Children
No data