This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ linked statically?


2009/5/26 Piotr Borys <piotr.borys@gmail.com>:
> 2009/5/26 Dimitry Andric <dimitry@andric.com>:
>> This is because you are using g++, which automagically adds the
>> -lstdc++. ?So please try using 'gcc' instead of 'g++'.
>
> ok, it built it this time, using gcc. But... the problem returned:
>
> $ ./parking
> Illegal instruction
>
> :(((

OK, I've managed to make it :))

First, I've made a symlink to static version of libstdc++ in my sources dir:

ln -s `arm-unknown-linux-uclibcgnueabi-g++ -print-file-name=libstdc++.a`

and then, in Makefile:

CC = $(CROSS)g++
LDFLAGS = -v -static-libgcc -L.

Notice it *has* to be g++, as gcc produces illegal code. After forcing
it to link libgcc statically and moving it to our isolated directory,
it linked libstdc++ statically - and the final code works properly on
a target machine! :D

cheers
-- 
Piotr "utak3r" Borys
http://utak3r.pl

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]