From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.189]) by ozlabs.org (Postfix) with ESMTP id 4C2FEDDE3A for ; Mon, 12 May 2008 19:12:46 +1000 (EST) Received: by ti-out-0910.google.com with SMTP id w7so871600tib.13 for ; Mon, 12 May 2008 02:12:44 -0700 (PDT) Message-ID: <4f8c3030805120212r730ded9dv23dfcc29119ebfe5@mail.gmail.com> Date: Mon, 12 May 2008 17:12:42 +0800 From: "Ramkumar J" To: linuxppc-embedded@ozlabs.org Subject: Compiling applications using cross compiler packs libc MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4564_3637462.1210583564086" List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , ------=_Part_4564_3637462.1210583564086 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi All, I am trying to execute a compiled simple stand-alone application ( TestApp_Memory.c compiled with gcc 4.1.0 cross compiler for ppc [ I have installed this through crosstool on a Linux PC ] ) on the ML403 Board instead of using the compiler-set provided by XPS. I tried many options ( like --static to gcc) to make the object file little as produced by the XPS Compiler Set. I find that when static is provided, the glibc is also packed up as a part of application though I never make any calls to the glibc libraries. If I dont provide the --static, the gcc produces a code assuming the library as shared and hence I get an interp section. Is there any way to produce the code with only the application and NOT the glibc ( As XPS compilers does). Am I missing out something. Is there any specific flags. I find even nodefaultlib does not work. For Eg: This is another example I tried int main() { int a = 5; int b = 10; int c = 15; c = a + b; c += 12; return 0; } With --static compilation, size is about 500K for the above code though the useful content is too less. objdump reveals unneccessary calls to the libc. Any suggestions would be helpful. Thanks and Regards, Ramkumar ------=_Part_4564_3637462.1210583564086 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hi All,

I am trying to execute a compiled simple stand-alone application ( TestApp_Memory.c compiled with gcc 4.1.0 cross compiler for ppc [ I have installed this through crosstool on a Linux PC ] ) on the ML403 Board instead of using the compiler-set provided by XPS. I tried many options ( like --static to gcc) to make the object file little as produced by the XPS Compiler Set. I find that when static is provided, the glibc is also packed up as a part of application though I never make any calls to the glibc libraries. If I dont provide the --static, the gcc produces a code assuming the library as shared and hence I get an interp section.
Is there any way to produce the code  with only the application and NOT the glibc ( As XPS compilers does). Am I missing out something. Is there any specific flags. I find even nodefaultlib does not work.

For Eg: This is another example I tried

int main()
{
    int a = 5;
    int b = 10;
    int c = 15;

    c = a + b;

    c += 12;

    return 0;
}

With --static compilation, size is about 500K for the above code though the useful content is too less. objdump reveals unneccessary calls to the libc.
Any suggestions would be helpful.

Thanks and Regards,
Ramkumar




------=_Part_4564_3637462.1210583564086--