Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#262 Cross compilation error for arm toolchain with gcc_4.5

5.2
closed-invalid
None
1
2014-08-28
2014-05-14
Amit
No

stlport build failed with the below logs:

[ 10s] + mkdir -p /home/abuild/rpmbuild/BUILDROOT/stlport-0.1-1.arm/usr/lib/pkgconfig/
[ 10s] + ./stlport.sh 0.1 /usr/lib /usr/include/stlport
[ 10s] + ./configure --prefix=/usr
[ 10s] + cd build/lib
[ 10s] + make all
[ 11s] c++: 2: No such file or directory
[ 11s] c++: 2: No such file or directory
[ 11s] c++: 2: No such file or directory
[ 11s] c++: 2: No such file or directory
[ 11s] c++: 2: No such file or directory
[ 11s] c++: 2: No such file or directory

[ 11s] c++ -pthread -fexceptions -fPIC -O2 -fvisibility=hidden 2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=vfpv3 -mfloat-abi=softfp -DSOFTFP -mthumb -Wa,-mimplicit-it=thumb -D_GNU_SOURCE -I../../stlport -c -o obj/gcc/so/dll_main.o ../../src/dll_main.cpp

[ 11s] c++: 2: No such file or directory

[ 12s] make: *** [obj/gcc/so/dll_main.o] Error 1
[ 12s] error: Bad exit status from /var/tmp/rpm-tmp.phpEXl (%build)

Root Cause:

This error was coming from write_option() function in configure file. This function removes the left hand string when it found first occurrence of “=“.

Like: If string is
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 –fexceptions

then write_option() function changes it to 2 –fexceptions

So, in this scenario “2” has left which has no meaning and causing above error.

Solution:

Changes in write_option () function of configure file.
write_over_option() {
target=echo $1 | sed -e 's/^[^=]*=2//'
echo $2 := $3$target >> ${configmak}
}

After above changes the result will reflect like below:
If string is
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 –fexceptions
then write_option() function changes it to –fexceptions

1 Attachments

Discussion

  • Amit
    Amit
    2014-05-14

    Please review my changes. Patch file attached

     
    Last edit: Amit 2014-05-15
    • Looks like nonsense.

       
  • uname -a
    Linux localhost 3.10.9+ #3 SMP Fri Aug 30 10:39:49 MSK 2013 x86_64 Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz GenuineIntel GNU/Linux

    On 6e66c6386c (head of master):

    ./configure --target=arm-continuous-linux-gnueabi
    make

    make -C src release-shared;
    make[1]: Entering directory '/export/home/ptr/source-lab/STLport/src'
    arm-continuous-linux-gnueabi-c++ -pthread -fexceptions -fPIC -O2 -std=gnu++0x -fvisibility=hidden -D_GNU_SOURCE -I../stlport -c -o obj/arm-continuous-linux-gnueabi-gcc/so/chrono.o chrono.cc
    ...

    (this build fail later, but this is another story).

    On 8742ffc (head of STLport-5.2):

    ./configure --target=arm-continuous-linux-gnueabi
    make
    make -C build/lib all;
    make[1]: Entering directory '/export/home/ptr/source-lab/STLport/build/lib'
    arm-continuous-linux-gnueabi-c++ -pthread -fexceptions -fPIC -O2 -fvisibility=hidden -D_GNU_SOURCE -I../../stlport -c -o obj/arm-continuous-linux-gnueabi-gcc/so/dll_main.o ../../src/dll_main.cpp
    arm-continuous-linux-gnueabi-c++ -pthread -fexceptions -fPIC -O2 -fvisibility=hidden -D_GNU_SOURCE -I../../stlport -c -o obj/arm-continuous-linux-gnueabi-gcc/so/fstream.o ../../src/fstream.cpp
    arm-continuous-linux-gnueabi-c++ -pthread -fexceptions -fPIC -O2 -fvisibility=hidden -D_GNU_SOURCE -I../../stlport -c -o obj/arm-continuous-linux-gnueabi-gcc/so/strstream.o ../../src/strstream.cpp
    arm-continuous-linux-gnueabi-c++ -pthread -fexceptions -fPIC -O2 -fvisibility=hidden -D_GNU_SOURCE -I../../stlport -c -o obj/arm-continuous-linux-gnueabi-gcc/so/sstream.o ../../src/sstream.cpp
    arm-continuous-linux-gnueabi-c++ -pthread -fexceptions -fPIC -O2 -fvisibility=hidden -D_GNU_SOURCE -I../../stlport -c -o obj/arm-continuous-linux-gnueabi-gcc/so/ios.o ../../src/ios.cpp
    arm-continuous-linux-gnueabi-c++ -pthread -fexceptions -fPIC -O2 -fvisibility=hidden -D_GNU_SOURCE -I../../stlport -c -o obj/arm-continuous-linux-gnueabi-gcc/so/stdio_streambuf.o ../../src/stdio_streambuf.cpp
    ...

    I have not checked the tests, but the libs built smoothly.

     
    • Group: 5.0 --> 5.2
    • Priority: 5 --> 2
     
    • status: open --> open-invalid
    • Priority: 2 --> 1
     
    • status: open-invalid --> closed-invalid