Cross Compiling Have Libgcc_S.so.1 And Libc.so.6 Error


silentbird70

Still Fresh
Joined
Aug 28, 2009
Messages
13
Location
Italy
Hello to everybody,
I'm new in this forum. I'm Italian and I apologize for my poor English.
I have buy the Wiz for my fun, and for my fun I start to cross compile some things.
I look in files download of Wiz at http://dl.openhandhelds.org/cgi-bin/wiz.cgi but I have not find yet a PDF reader.
So I try some things from myself. I cross compile the QT4 enbedded library and Poppler library (PDF management library),
using toolchain find at http://dl.openhandhelds.org/cgi-bin/wiz.cgi?0,0,0,0,14,8 and installed on a Xubuntu whith path /opt/arm-openwiz-linux-gnu.
I have added to the toolchain the request library: zlib, libpng, font library, etc.
The cross compile went well. I follewed much of indication on this forum. But now I have a problem with libgcc_s.so.1 and libc.so.6 library.
I try the cross compilation that I made with a small program that open a PDF files and write a page in PNG format to disk. Also that program well compiled.
I copy the program and all QT and Poppler library needed on a SD directory, but when I run it, this error appears:

./ApriPDF_wiz: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libQtGui.so.4)
./ApriPDF_wiz: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libQtCore.so.4)
./ApriPDF_wiz: /lib/libc.so.6: version `GLIBC_2.4' not found (required by ./libQtCore.so.4)
./ApriPDF_wiz: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libpoppler.so.2)

ApriPDF_wiz is my program

I read something about that on this forum. Then I copy libgcc_s.so.1 and libc.so.6 from the toolchain at this directory:

/opt/arm-openwiz-linux-gnu/arm-openwiz-linux-gnu/sys-root/usr/lib

to the program directory, but now, when I run the program, blanck screen appear.

I try to run the program with terminal of Qtopia and I have this error:

cannot handle file 'libc.so.6' with TLS data

I have update the firmware from 1.0.0 to 1.1.0 but not change.

I try the program in a normal system and it well function. Now I have no more ideas. Some of you can help me about this problem.

Thanks to all in advance
 
Yes I have used -O3 optimization. I try without any, then I post the result.

Thanks a lot for reply :D
 
I'm here with the result of my work.
I Recompile QT4 embedded with CFLAGS="-DGP2X -DIS_LITTLE_ENDIAN -D_REENTRANT -DGP2X_ASM -I/opt/arm-openwiz-linux-gnu/include -L/opt/arm-openwiz-linux-gnu/lib"
In the toolchain I have not reinstalled QT4 embedded library. I just replace QtCore and QtGui library recompiled without optimization
I Recompile and Reinstall Poppler library with the same CFLAGS options
Then I have recompiled my program in this way:

/opt/arm-openwiz-linux-gnu/bin/arm-openwiz-linux-gnu-g++ -I/opt/arm-openwiz-linux-gnu/include/poppler -I/opt/arm-openwiz-linux-gnu/include -L/opt/arm-openwiz-linux-gnu/lib -Wl,-rpath,/opt/arm-openwiz-linux-gnu/lib -o ApriPDF_wiz ApriPDF.cpp -lpoppler-qt4

Running the program the same problem I described before it appears on may output

Next there is the way I run the program:

------------------------------------------
#!/bin/sh

#Avvia Applicazione
./ApriPDF_wiz >stdout.txt 2>stderr.txt

# Ritorno allo Schermo del Menu'
cd /usr/gp2x
exec /usr/gp2x/gp2xmenu
------------------------------------------

I have try to run the example compiled with QT4 library, but no valid result there was. The errors are the same.

Pickle do you have another ideas about this problem?

Do you know if there is a way to test that I have not use any optimization for the total process? I means testing library and programs with a tool program.

Now I think that compiling QT4 library are used some programs tools like bootstrap, moc, rcc, uic with a -O2 optimization, but I hope is not important.
For me QtCore and QtGui are important

What do you think about Pickle?

Does Anybody have a clue?
 
./ApriPDF_wiz: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libQtGui.so.4)
./ApriPDF_wiz: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libQtCore.so.4)
./ApriPDF_wiz: /lib/libc.so.6: version `GLIBC_2.4' not found (required by ./libQtCore.so.4)
./ApriPDF_wiz: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libpoppler.so.2)

without libgcc_s.so.1 and libc.so.6 in program directory

and black screen with libgcc_s.so.1 and libc.so.6. In this case I don't know what exactly happens, no stdout.txt and no stderr.txt are created

The program should open an png image generated from a PDF document page

In this topic:

http://www.gp32x.de/board/index.php?/topic/49295-error-while-loading-shared-library-although-its-there/

tell to use LD_PRELOAD. It's a possible solution?
 
Last edited by a moderator:
TomSeaGull said:
./ApriPDF_wiz: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libQtGui.so.4)
./ApriPDF_wiz: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libQtCore.so.4)
./ApriPDF_wiz: /lib/libc.so.6: version `GLIBC_2.4' not found (required by ./libQtCore.so.4)
./ApriPDF_wiz: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libpoppler.so.2)

without libgcc_s.so.1 and libc.so.6 in program directory

and black screen with libgcc_s.so.1 and libc.so.6. In this case I don't know what exactly happens, no stdout.txt and no stderr.txt are created

The program should open an png image generated from a PDF document page

In this topic:

http://www.gp32x.de...ough-its-there/

tell to use LD_PRELOAD. It's a possible solution?

I dont think you have a problem with putting the libs there and them not being found. The libgcc I think i fine to leave, Ive done it many times its the libc and the TLS error that I think is a problem. I think i saw it once with quake but it went away if I didnt use -02.
Also ive had issues with GPH libpng, I your better off using the one in the toolchain.
 
Last edited by a moderator:
Thanks Pickle for your replay :D This make me in condition to continue my work

- Now I remove, from QtGui e QtCore library compilation, the -Wl,-O1 flag and I copy library in the toolchain
- But otherwise recompiling Poppler library, I have an error described below, in Poppler-QT4 tests:

---------------------------------------------------------------------------------------------------------------------------------------------
libtool: link: warning: library `/opt/arm-openwiz-linux-gnu/arm-openwiz-linux-gnu/lib/libstdc++.la' was moved.
/opt/arm-openwiz-linux-gnu/lib/libQtGui.so.4: undefined reference to `QWSSoundServerClient::playPriorityOnly(bool)'
/opt/arm-openwiz-linux-gnu/lib/libQtGui.so.4: undefined reference to `QWSSoundServerClient::setSilent(bool)'
/opt/arm-openwiz-linux-gnu/lib/libQtGui.so.4: undefined reference to `vtable for QWSSoundServer'
/opt/arm-openwiz-linux-gnu/lib/libQtGui.so.4: undefined reference to `QWSSoundServer::soundCompleted(int)'
.............
.............
/opt/arm-openwiz-linux-gnu/lib/libQtGui.so.4: undefined reference to `QWSSoundServerClient::stopAll(int)'
/opt/arm-openwiz-linux-gnu/lib/libQtGui.so.4: undefined reference to `vtable for QAuServerQWS'
/opt/arm-openwiz-linux-gnu/lib/libQtGui.so.4: undefined reference to `QWSSoundServerClient::playRaw(int, int, QString const&, int, int, int, int)'
/opt/arm-openwiz-linux-gnu/lib/libQtGui.so.4: undefined reference to `QWSSoundServerClient::setMute(int, int, bool)'
collect2: ld returned 1 exit status
make[3]: *** [test-poppler-qt4] Errore 1
make[2]: *** [all-recursive] Errore 1
make[1]: *** [all-recursive] Errore 1
make: *** [all] Errore 2
---------------------------------------------------------------------------------------------------------------------------------------------

Omitting Poppler-QT4 tests and installing Poppler library in the toolchain, my program does not more compile, with an error like above

Where can I find GPH libpng? I have not install it on my toolchain. I have normal libpng, and with SDL_image used on an other my program, not work (no PNG image displayed)

I try a demo of QT4 Embedded about gradients that indeed not use libPNG and the problem is the same:

./gradients: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libQtGui.so.4)
./gradients: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libQtCore.so.4)
./gradients: /lib/libc.so.6: version `GLIBC_2.4' not found (required by ./libQtCore.so.4)

And with libgcc_s.so.1,libc.so.6 black screen

It this moment I'm recompiling the essential QT4 library: QtCore, QtNetwork and QtGui more clearly. Maybe I make same mistakes :unsure:
Then I use gradients program to test library

Now my question is: -Wl,-O1 flag is important? Can I omit it? Or Can I use it without problem? Is a flag present on QT4 library compilation

Here http://www.gp32x.de/board/index.php?/topic/46371-using-devkitgp2x-in-the-wiz/ tells about libm.so and libpthread.so library on Devkitgp2x use.
Do I have to change that two library like on this topic?

Thanks again. I hope to get something good about this job :D so as to be useful

Bye!
 
Last edited by a moderator:
TomSeaGull said:
Where can I find GPH libpng? I have not install it on my toolchain. I have normal libpng, and with SDL_image used on an other my program, not work (no PNG image displayed)
No what i mean i something i wrong with GPH's lib, so just find the library in the toolchain and copy to where ever your program is, it will override the GPH lib.

TomSeaGull said:
And with libgcc_s.so.1,libc.so.6 black screen
Maybe a good sign that the program is running, just something else is wrong, maybe try using gdb and start stepping through the app.

TomSeaGull said:
Now my question is: -Wl,-O1 flag is important? Can I omit it? Or Can I use it without problem? Is a flag present on QT4 library compilation
For now I would not use any -O1,2,or 3
 
Last edited by a moderator:
Pickle said:
TomSeaGull said:
Where can I find GPH libpng? I have not install it on my toolchain. I have normal libpng, and with SDL_image used on an other my program, not work (no PNG image displayed)
No what i mean i something i wrong with GPH's lib, so just find the library in the toolchain and copy to where ever your program is, it will override the GPH lib.

Wow!! Fantastic!! My SDL program load PNG correctly (I just put PNG library installed in toolchain). Excuse me, befor I have not understood (my poor English)

Thanks!!

For other interesting things you said, I work on. It takes a long time to try recompile.

When I have good news I post it

Bye, for the moment
 
Last edited by a moderator:
Pickle said:
TomSeaGull said:
./ApriPDF_wiz: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libQtGui.so.4)
./ApriPDF_wiz: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libQtCore.so.4)
./ApriPDF_wiz: /lib/libc.so.6: version `GLIBC_2.4' not found (required by ./libQtCore.so.4)
./ApriPDF_wiz: /lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by ./libpoppler.so.2)

without libgcc_s.so.1 and libc.so.6 in program directory

and black screen with libgcc_s.so.1 and libc.so.6. In this case I don't know what exactly happens, no stdout.txt and no stderr.txt are created

The program should open an png image generated from a PDF document page

In this topic:

http://www.gp32x.de...ough-its-there/

tell to use LD_PRELOAD. It's a possible solution?

I dont think you have a problem with putting the libs there and them not being found. The libgcc I think i fine to leave, Ive done it many times its the libc and the TLS error that I think is a problem. I think i saw it once with quake but it went away if I didnt use -02.
Also ive had issues with GPH libpng, I your better off using the one in the toolchain.

Hi
I have retry to recompile with no kind of optimizzation. I had no resolution to problem.
With gdb I find the exact error:

error while loading shared libraries: libc.so.6: cannot handle TLS data

But what means exactly? Is compile without ottimizzation the only solution?
In my toolchain I have installed glib-2.0, is a problem? I have to use all added compiled library in toolchain without ottimization?
 
Last edited by a moderator:
I had the same kind of issue while porting Stella (Wiz-2600) to Wiz. The best solution i've found is to link statically stdc++ and to put the libgcc_s.so.1 of the toolchain with my wiz2600.gpe binary in the same folder. (Have a look to the wiz-2600 Makefile available on my blog)
 
Thanks zx for your help

I try to compile the Qt4 library like you suggest and I use a demo gradient to test, compiled in the same way.
The program continues to require /lib/libc.so.6 library (I don't take it in my program directory)

I compile the static version too, for take all in one file, but the request is ever /lib/lib.so.6

I try to link with libc.a and libc_nonshared.a, but without result and with same error:

/opt/arm-openwiz-linux-gnu/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: /opt/arm-openwiz-linux-gnu/arm-openwiz-linux-gnu/sys-root/usr/lib/libc.a(ctype-info.o)(.text+0x40): R_ARM_TLS_LE32 relocation not permitted in shared object
..................
/opt/arm-openwiz-linux-gnu/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: /opt/arm-openwiz-linux-gnu/arm-openwiz-linux-gnu/sys-root/usr/lib/libc.a(malloc.o)(.text+0xe0): R_ARM_TLS_LE32 relocation not permitted in shared object
..................
/opt/arm-openwiz-linux-gnu/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: /opt/arm-openwiz-linux-gnu/arm-openwiz-linux-gnu/sys-root/usr/lib/libc.a(dl-tsd.o)(.text+0x14): R_ARM_TLS_LE32 relocation not permitted in shared object

And using -static flag this error occur:

/mnt/00_QT/qt-embedded-linux-opensource-src-4.5.2/lib/libQtCore.a(qfsfileengine_unix.o): In function `QFSFileEngine::eek:wner(QAbstractFileEngine::FileOwner) const':
qfsfileengine_unix.cpp:(.text+0xff8): warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
qfsfileengine_unix.cpp:(.text+0xe20): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/mnt/00_QT/qt-embedded-linux-opensource-src-4.5.2/lib/libQtNetwork.a(qhostinfo_unix.o): In function `QHostInfoAgent::fromName(QString const&)':
qhostinfo_unix.cpp:(.text+0x1a74): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

Maybe, in this case, there is no possibility to not use /lib/libc.so.6

However thanks to all
 
Back
Top