[uClinux-dev] building gcc 3.4.4

Jeff Bacon jbac.uc.dev at gmail.com
Thu Jun 11 10:07:01 EDT 2009


Sorry, I meant to post back on this topic, but yes, the fixes worked as
advertised. I haven't tested every little piece of the compiler, but I
can confirm that it gives me working userland XIP now, and nothing else
seems broken. The whole reason I had to re-compile in the first place
was to add the "-msingle-pic-base" flag to libgcc in order to get
everything working correctly.

For those interested these were the changes I had to make to get through
Greg's steps without any errors:

1) Save yourself some heartache, do this on a FC3 machine like Greg suggests

2) all build steps that have this line
"--with-headers=linux-2.4.x/include" need to be changed to your
_absolute_ path (i.e. you CANNOT use ../../../linux-2.4.x/include, you
must directly specify the path starting at /).

3) When building glibc for little endian targets (steps 5 and 7) and
using the glibc-2.3.3 source, you MUST apply this patch(from the thread
I referenced earlier):

diff -Nru glibc-2.3.3-base/scripts/output-format.sed.orig
glibc-2.3.3-base/scripts/output-format.sed
--- glibc-2.3.3-base/scripts/output-format.sed.orig    2002-12-08
00:13:16.000000000 -0800
+++ glibc-2.3.3-base/scripts/output-format.sed    2008-10-06
12:06:51.636090192 -0700
@@ -7,7 +7,7 @@
 : o
 s/^.*OUTPUT_FORMAT(\([^,]*\), \1, \1).*$/OUTPUT_FORMAT(\1)/
 t q
-s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\2,\3/
+s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\1,\2,\3/
 t s
 s/^.*OUTPUT_FORMAT(\([^,)]*\).*$)/OUTPUT_FORMAT(\1)/
 t q
@@ -16,8 +16,9 @@
 s/"//g
 G
 s/\n//
-s/^\([^,]*\),\([^,]*\),B/OUTPUT_FORMAT(\1)/p
-s/^\([^,]*\),\([^,]*\),L/OUTPUT_FORMAT(\2)/p
+s/^\([^,]*\),\([^,]*\),\([^,]*\),B/OUTPUT_FORMAT(\2)/p
+s/^\([^,]*\),\([^,]*\),\([^,]*\),L/OUTPUT_FORMAT(\3)/p
+s/^\([^,]*\),\([^,]*\),\([^,]*\)/OUTPUT_FORMAT(\1)/p
 /,/s|^|*** BUG in libc/scripts/output-format.sed *** |p
 q
 : q  



4) Add the "elf2flt" steps from Greg's GCC 4.2.1 build steps since you
need it for this package as well.


-JB

Greg Ungerer wrote:
> Hi Jeff,
>
> Jeff Bacon wrote:
>> After searching the list some more, It looks like someone else has run
>> into this issue before.
>>
>> I will follow the directions referenced in the thread "woo with
>> building gcc-3.4.4" to see if those help.
>
> Did they help?
>
> Regards
> Greg
>
>
>
>> On Thu, Jun 4, 2009 at 6:29 PM, Jeff Bacon <jbac.uc.dev at gmail.com>
>> wrote:
>>> Ok, so I've figured out that it has to point to my specific headers to
>>> compile, and I've made it through almost all of the steps EXCEPT for
>>> one of the last ones, step 8(repeated here):
>>>
>>> ********************************************************************************************************
>>>
>>> 8. gcc-3.4.4 (c++, etc)
>>>
>>>   tar xvzf gcc-3.4.4.tar.gz
>>>   cd gcc-3.4.4
>>>
>>>   cp $(ATTACHED t-linux file) gcc/config/arm/
>>>   vi gcc/config/arm/t-linux
>>>      - remove all "-Dinhibit_libc" occruances
>>>   vi gcc/config/arm/linux-elf.h
>>>     -- remove line that defines LIBGCC_SPEC
>>>   perl -pi -e 's/int namelen/unsigned int namelen/'
>>> libjava/java/net/natInetAddressPosix.cc
>>>
>>>   mkdir arm-linux
>>>   cd arm-linux
>>>   ../configure --target=arm-linux --disable-shared \
>>>        --prefix=/usr/local --with-headers=linux-2.4.x/include \
>>>        --with-gnu-as --with-gnu-ld --enable-multilib
>>>   make
>>>   make install
>>> ********************************************************************************************************
>>>
>>>
>>> The compilation makes it almost all the way through until it hits the
>>> section where it's working on libstdc++-v3, where it dies with this
>>> error:
>>>
>>> <snip>
>>> checking for float.h... (cached) yes
>>> checking for stdint.h... (cached) yes
>>> checking for main in -lm... configure: error: Link tests are not
>>> allowed after GCC_NO_EXECUTABLES.
>>> make: *** [configure-target-libstdc++-v3] Error 1
>>> [root at localhost arm-linux]#
>>>
>>>
>>> I'm so close I can taste it, can anyone (Greg??) help me out here? I'm
>>> following Greg's instructions EXACTLY, so if anyone else has then they
>>> would have had to have seen this error I would think. I'm building it
>>> on the recommended Fedora Core 3 machine by the way...
>>>
>>>
>>> -JB
>>>
>>>
>> _______________________________________________
>> uClinux-dev mailing list
>> uClinux-dev at uclinux.org
>> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
>> This message was resent by uclinux-dev at uclinux.org
>> To unsubscribe see:
>> http://mailman.uclinux.org/mailman/options/uclinux-dev
>>
>




More information about the uClinux-dev mailing list