Compile/link problem (help needed! :-) )

Hello to everybody on this mailing list!

I have a small problem (and I can’t immagine the reason for it) using
SDL. Recently I upgraded to Mandrake 6.1 and wanted to code something
with SDL (great library!). So I fetched the 1.0.6 RPMs from the download
section and installed SDL.

The problem: when I try to compile something with the SDL-library (ie
some of the SDL-Demos or in the /test dir) and then run the resulting
executable, it just hangs immediately. (I can’t even run ./configure
because it hangs when testing the SDL-version)

Using ddd (gdb) to see what the problem could be, it was rather
surprising to me that it hangs before even getting to main{}. When I
interrupt the program and use backtrace, it says:

#1 0x2ac612c0 in DTOR_END () from /lib/libc.so.6
#0 0x2ab8a378 in sigsuspend () from /lib/libc.so.6

I have to admit that I’m not very experienced in linux programming and I
don’t know what the above functions should do (ok, sigsuspend does
suspending, but why here and now?)

I use pgcc-2.91.66 and glibc-2.1.1. (I think these are rather new ones)

I hope that someone could give me an advice what to do…

thx, Lorenz

I have a small problem (and I can’t immagine the reason for it) using
SDL. Recently I upgraded to Mandrake 6.1 and wanted to code something
with SDL (great library!). So I fetched the 1.0.6 RPMs from the download
section and installed SDL.

Try getting the source RPM and rebuilding it.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Hello to everybody on this mailing list!

I have a small problem (and I can’t immagine the reason for it) using
SDL. Recently I upgraded to Mandrake 6.1 and wanted to code something
with SDL (great library!). So I fetched the 1.0.6 RPMs from the download
section and installed SDL.

Maybe I’m just paranoid, but why not try it w/o the RPMs? Grab a source tarball
and expand it in your /usr/local/src directory, see if that works. I’ve had
more than my fair share of insidious linking problems with RPMs during my
lifetime. (I still need to get that /dev/3dfx driver working…)

thx, Lorenz

Nicholas

vining at pacificcoast.net wrote:

Maybe I’m just paranoid, but why not try it w/o the RPMs? Grab a source tarball
and expand it in your /usr/local/src directory, see if that works. I’ve had
more than my fair share of insidious linking problems with RPMs during my
lifetime. (I still need to get that /dev/3dfx driver working…)

Ok, now I rebuilt everything with the source tarball, installed it in
/usr/local, updated
ld with ldconfig and it still does the same thing. (the program hangs
before getting to main{} and is in sigsuspend() from libc )
:frowning:

Don’t you think there could be a problem with the compiler / libc /
threads ?

thx for advices, Lorenz

vining at pacificcoast.net wrote:

Maybe I’m just paranoid, but why not try it w/o the RPMs? Grab a source tarball
and expand it in your /usr/local/src directory, see if that works. I’ve had
more than my fair share of insidious linking problems with RPMs during my
lifetime. (I still need to get that /dev/3dfx driver working…)

Ok, now I rebuilt everything with the source tarball, installed it in
/usr/local, updated
ld with ldconfig and it still does the same thing. (the program hangs
before getting to main{} and is in sigsuspend() from libc )
:frowning:

Don’t you think there could be a problem with the compiler / libc /
threads ?

Have you run ldconfig to make sure your program is using the newly installed
library?

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Sam Lantinga wrote:

Have you run ldconfig to make sure your program is using the newly installed
library?

and if you don’t use a rather new SuSE distribution (they finally
default to include it in the ld search path since 6.2 AFAIK) make sure
that /usr/local/lib is in /etc/ld.so.conf–
Daniel Vogel My opinions may have changed,
666 @ http://grafzahl.de but not the fact that I am right

“L.Pollak” wrote:

Hello to everybody on this mailing list!

I have a small problem (and I can’t immagine the reason for it) using
SDL. Recently I upgraded to Mandrake 6.1 and wanted to code something
with SDL (great library!). So I fetched the 1.0.6 RPMs from the download
section and installed SDL.

surprising to me that it hangs before even getting to main{}. When I
interrupt the program and use backtrace, it says:

#1 0x2ac612c0 in DTOR_END () from /lib/libc.so.6
#0 0x2ab8a378 in sigsuspend () from /lib/libc.so.6

First, before you upgraded, had you individually upgraded any of your
libraries or compiler tools? If Mandrake saw something newer than what
it has, it may not have upgraded it. Try running gcc with the -v flag
when you compile and link. It will print out a huge gob of information
about the libraries and includes it’s using.

Jeff Freedman wrote:

surprising to me that it hangs before even getting to main{}. When I
interrupt the program and use backtrace, it says:

#1 0x2ac612c0 in DTOR_END () from /lib/libc.so.6
#0 0x2ab8a378 in sigsuspend () from /lib/libc.so.6

First, before you upgraded, had you individually upgraded any of your
libraries or compiler tools? If Mandrake saw something newer than what
it has, it may not have upgraded it. Try running gcc with the -v flag
when you compile and link. It will print out a huge gob of information
about the libraries and includes it’s using.

I used an empty partition for the new madrake-linux, so everything
should be ok with the distribution…

I compiled the testver-program in the test dir with the -v flag and
thats what it says:-----
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.91.66/specs
gcc version pgcc-2.91.66 19990314 (egcs-1.1.2 release)
/usr/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.91.66/cpp -lang-c -v
-I/usr/local/include/SDL -undef -D__GNUC__=2 -D__GNUC_MINOR__=91
-D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -D__ELF__ -D__unix__
-D__i386__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux
-Asystem(posix) -g -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386
-D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__
-D__pentiumpro -D__pentiumpro__ testver.c /tmp/cc9zQuSb.i
GNU CPP version pgcc-2.91.66 19990314 (egcs-1.1.2 release) (i386
Linux/ELF)
#include “…” search starts here:
#include <…> search starts here:
/usr/local/include/SDL
/usr/local/include
/usr/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.91.66/include
/usr/include
End of search list.
/usr/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.91.66/cc1 /tmp/cc9zQuSb.i
-quiet -dumpbase testver.c -g -version -o /tmp/ccM0ibbq.s
GNU C version pgcc-2.91.66 19990314 (egcs-1.1.2 release)
(i686-pc-linux-gnu) compiled by GNU C version pgcc-2.91.66 19990314
(egcs-1.1.2 release).
as -V -Qy -o /tmp/cczkvgb3.o /tmp/ccM0ibbq.s
GNU assembler version 2.9.1 (i386-mandrake-linux), using BFD version
2.9.1.0.25
/usr/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.91.66/collect2 -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 -o testver /usr/lib/crt1.o
/usr/lib/crti.o
/usr/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.91.66/crtbegin.o
-L/usr/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.91.66 /tmp/cczkvgb3.o -lSDL
-lpthread -lgcc -lc -lgcc
/usr/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.91.66/crtend.o /usr/lib/crtn.o

Could it be that this compiler-version won’t work properly on my k6-200
machine?

cu, Lorenz

“L.Pollak” wrote:

Fresh install, no obvious inconsistencies in the ‘-v’ output; I’m
stumped:-(

Could it be that this compiler-version won’t work properly on my k6-200
machine?

Well, I’m using egcs 2.91.66 on a k6-2/p333; I haven’t heard of pgcc,
but I’d guess it’s the same thing. (Anyone know for sure?) This is on a
Suse6.2 system, which I recently installed because I couldn’t get SDL to
work on my old Redhat5.2. Have you tried compiling and running a
program whose only code is SDL_Init() inside ‘main’? Can you compile
and run other programs, such as a simple “Hello world”, or something
that’s plain XLib?

Now, I do notice that your compiler is set up for ‘pentiumpro’ and
’i686’, while mine is for i386. So maybe there is a problem with that
setup (which is probably the default with Mandrake) and SDL.