problem about uclibc-Collection of common programming errors


  • user1091344
    gcc debian cross-compiling ada uclibc
    I compiled a GCC 4.8.1 Cross-Compiler (BUILD/HOST: debian/glibc, TARGET: alpinelinux/uclibc). The C compiler is working great, but Ada won’t work at moment.juan@debian:~/HelloAda$ x86_64-alpine-linux-uclibc-gnatmake hello.adb x86_64-alpine-linux-uclibc-gcc -c hello.adb x86_64-alpine-linux-uclibc-gnatbind -x hello.ali x86_64-alpine-linux-uclibc-gnatlink hello.ali /home/juan/opt/cross/lib/gcc/x86_64-alpine-linux-uclibc/4.8.1/adalib/libgnat.a(adaint.o): In function `__gnat_cpu_alloc’: /home/juan/GCC/obj/gcc/ada/rts/adaint.c:3797: undefined reference to `__sched_cpualloc’ /home/juan/opt/cross/lib/gcc/x86_64-alpine-linux-uclibc/4.8.1/adalib/libgnat.a(adaint.o): In function `__gnat_cpu_free’: /home/juan/GCC/obj/gcc/ada/rts/adaint.c:3807: undefined reference to `__sched_cpufree’ collect2: error: ld returned 1 exit status x86_64-alpine-linux-uclibc-gnatlink: error when calling /home/juan/opt/cross/bin/x86_64-alpine-linux-uclibc-gcc x86_64-alpine-linux-uclibc-gnatmake: *** link failed./home/juan/GCC/obj/gcc/ada/rts/adaint.c: http://nopaste.info/ffcb612692.html/usr/include/sched.h: http://nopaste.info/5332aed42a.html /usr/include/bits/sched.h: http://nopaste.info/46323ab5d8.html/opt/alpine/usr/include/sched.h: http://nopaste.info/998896bafe.html /opt/alpine/usr/include/bits/sched.h: http://nopaste.info/e8cfbd2844.htmlDoes someone know, what’s going wrong?A more verbose output of what is going on:juan@debian:~/HelloAda$ x86_64-alpine-linux-uclibc-gcc -c hello.adb juan@debian:~/HelloAda$ x86_64-alpine-linux-uclibc-gnatbind hello juan@debian:~/HelloAda$ x86_64-alpine-linux-uclibc-gnatlink -v -v helloGNATLINK 4.8.1 Copyright (C) 1995-2013, Free Software Foundation, Inc. x86_64-alpine-linux-uclibc-gcc -c -mtune=generic -march=x86-64 -gnatA -gnatWb -gnatiw -v -gnatws /home/juan/HelloAda/b~hello.adb Using built-in specs. COLLECT_GCC=/home/juan/opt/cross/bin/x86_64-alpine-linux-uclibc-gcc Target: x86_64-alpine-linux-uclibc Con

  • Brian Bruggeman
    gcc arm gentoo cross-compile uclibc
    Can anyone help with my ARM + GCC + UCLIBC linking issue with crossdev?Also posted to Gentoo Forums here: http://forums.gentoo.org/viewtopic-t-925012.htmlRecently, I was assigned to a project that has executables developed using an old GCC with OABI. As a point of reference, here’s a header output from readelf of an executable that runs just fine on the system:ELF Header:Magic: 7f 45 4c 46 01 01 01 61 00 00 00 00 00 00 00 00 Class: ELF32Data: 2’s complement, little endianVersion: 1 (current)OS/ABI: ARMABI Version: 0Type: EXEC (Executable file)Machine: ARMVersion: 0x1Entry point address: 0x9464Start of program headers: 52 (bytes into file)Start of section headers: 540956 (bytes into file)Flags: 0x202, has entry point, GNU EABI, software FPSize of this header: 52 (bytes)Size of program headers: 32 (bytes)Number of program headers: 6Size of section headers: 40 (bytes)Number of section headers: 35Section header string table index: 32I creaed a cross-compiler using crossdev and the latest gcc/binutils/linux-headers/etc. and with EABI. $ crossdev arm-softfloat-linux-uclibceabiI quite happily began to populate my local folder with executables using that cross compiler only to later try the executable on my hardware and find out that I ended up with a segmentation fault. I realized, only through quite a bit of googling, that I really needed to have the old, legacy ABI for uclibc: OABI. My previous cross compiler was from circa 2005.As another point of reference, my executables with eabi were producing headers from readelf that look a bit like this:ELF Header:Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32Data: 2’s complement, little endianVersion: 1 (current)OS/ABI: UNIX – System VABI Version: 0Type: EXEC (Executable file)Machine: ARMVersion: 0x1Entry point address: 0x8130Start of program headers: 52 (bytes into file)Start of section headers: 21284 (bytes into file)Flags: 0x5000002, has entry point, Version5 EABISize of this header: 52 (bytes)Size of program headers: 32 (bytes)Number of program headers: 7Size of section headers: 40 (bytes)Number of section headers: 21Section header string table index: 18While the Machine is the same, the segmentation fault doesn’t provide a way to execute the binary on the target.After googling more, I found that there may be a way to produce some code with the eabi compiler for the legacy system. I was quite happy when I ran this command:$ arm-softfloat-linux-uclibceabi-gcc -mabi=apcs-gnu -static -c -o /mnt/arm_uclibc/tmp/test /mnt/arm/tmp/test.c && readelf -h /mnt/arm_uclibc/tmp/testAnd I ended up with:ELF Header:Ma

  • PoltoS
    c gcc cross-compiling uclibc
    I’m trying to build a project for ARM uClibc environment, but I’ve some functions missing. Can not find which library shall I include to resolve dependancies. nm do not help me to search, since it says on most of libs coming with toolchain:nm: ./host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/lib/libuClibc-0.9.32.1.so: no symbolsHere is the output from GCC:./host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc-Wl,-rpath,./host/usr/lib/-Wl,-rpath,./host/usr/../lib/-Wl,-rpath,./host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/lib/-Llibzway -o test_so main.o -lzway-L./host/us

  • Francesco
    gcc ld uclibc angstrom-linux openembedded
    I am trying to build an application for angstrom linux (that uses uclibc instead of libstdc++, in my case). I am using bitbake and openembedded. With a simple toolchain I am able to build successfully by adding only -muclibc flag. With bitbake my build command is the followingarm-angstrom-linux-gnueabi-gcc -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mno-thumb –sysroot=/home/hnsl/stuff/tmp/sysroots/armv7a-angstrom-linux-gnueabi -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb2 -Wl,-O1 -Wl,–hash-style=gnu -muclibc mainThread.cpp lib.cpp -lportaudiowhere -muclibc mainThread.cpp lib.cpp -lportaudio is done by me. Portaudio (-lportaudio) is linked successfully. Uclibc (I think) fails to be linked; I get these errors:/tmp/ccW4SVb4.o: In function `main’: | /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/mainThread.cpp:68: undefined reference to `__cxa_end_cleanup’ | /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/mainThread.cpp:68: undefined reference to `__cxa_begin_catch’ | /tmp/ccW4SVb4.o: In function `operator

Originally posted 2013-11-09 19:44:26.