Skip to contentSkip to conversation

xfree86 build problem

parisc-linux Grant Grundler 4 participants 8 messages Apr 13, 2001 – Apr 15, 2001

lore
Share & tools
lore
#0 lore raw

hi folks,

The xfree86 build dies with the following errors:
...
making all in lib/GL/glu/libutil...
make[3]: Entering directory `/home/src/xfree86-4.0.2/build-tree/xc/lib/GL/glu/libutil'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/src/xfree86-4.0.2/build-tree/xc/lib/GL/glu/libutil'
rm -f libGLU.so.1.3~
+ cd .
+ c++ -o ./libGLU.so.1.3~ -shared -Wl,--whole-archive -Wl,-soname,libGLU.so.1 libutil/libutil.a libtess/libtess.a libnurbs/internals/libinternals.a libnurbs/interface/libinterface.a libnurbs/nurbtess/libnurbtess.a -Wl,--no-whole-archive /usr/bin/ld: error.o: relocation R_PARISC_DPREL21L can not be used when making a shared object; recompile with -fPIC
libutil/libutil.a(error.o): could not read symbols: Bad value
collect2: ld returned 1 exit status
+ rm -f libGLU.so.1
+ ln -s libGLU.so.1.3 libGLU.so.1
+ rm -f ../../../exports/lib/libGLU.so.1
+ cd ../../../exports/lib
+ ln -s ../../lib/GL/glu/libGLU.so.1 .
rm -f libGLU.so.1.3
mv -f libGLU.so.1.3~ libGLU.so.1.3
mv: cannot stat `libGLU.so.1.3~': No such file or directory
make[2]: *** [libGLU.so.1.3] Error 1
make[2]: Leaving directory `/home/src/xfree86-4.0.2/build-tree/xc/lib/GL/glu'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/src/xfree86-4.0.2/build-tree/xc/lib/GL'
make: *** [all] Error 2

a500:/usr/src/xfree86-4.0.2/build-tree/xc/lib# file GL/glu/libutil/error.o
GL/glu/libutil/error.o: ELF 32-bit MSB relocatable, PA-RISC, version 1, not stripped

1) error.o was built with:
gcc -c -O2 -g -ansi -pedantic -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -I../include -I../../../../include -I../../../../include/GL -I../../../.. -I../../../../exports/include -Dlinux -D_POSIX_SOURCE -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DX_LOCALE -DFUNCPROTO=15 -DNARROWPROTO -DNDEBUG error.c
Is the -fPIC missing here?
If so, why does "file" say it's relocatable?

I rebuilt error.o and glue.o by hand with -fPIC, rebuilt the libutil.a, and then the build proceeded (until it hit the next problem).

2) c++ isn't returning the error reported by collect2 Fortunately the build soon dies since the expected product doesn't exist. Known problem?

grant

#1 lore raw
Quoted 3 lines · Grant Grundler

1) error.o was built with:
gcc -c -O2 -g -ansi -pedantic -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -I../include -I../../../../include -I../../../../include/GL -I../../../.. -I../../../../exports/include -Dlinux -D_POSIX_SOURCE -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DX_LOCALE -DFUNCPROTO=15 -DNARROWPROTO -DNDEBUG error.c
Is the -fPIC missing here?

Yes (or error.o shouldn't be included in the shared lib)

Quoted 1 line

If so, why does "file" say it's relocatable?

Because it is. :) Relocatable files don't have to be PIC.

Quoted 3 lines

2) c++ isn't returning the error reported by collect2 Fortunately the build soon dies since the expected product doesn't exist. Known problem?

Are you sure about this statement? It might just be "make" (the presense of those `+'s is ringing bells with me but I don't recall the exact signifigance.)

Alan

#2 lore raw
Quoted 7 lines · [email protected] wrote:
Quoted 3 lines

2) c++ isn't returning the error reported by collect2 Fortunately the build soon dies since the expected product doesn't exist. Known problem?

Are you sure about this statement? It might just be "make" (the presense of those `+'s is ringing bells with me but I don't recall the exact signifigance.)

I'm not. It might be a make bug.
I've seen make say something like "[ ... ignored ]" when ignoring an error.

Anyway, after spending another two hours on the -fPIC problem, I'm starting to think the xfree86 lib build is broken by design for __hppa__. I'll send out another mail with a patch + recipe for building the libs. I'm pretty close to finding workarounds (not solutions) for the problems.

Do other arches allow non-PIC .o's to be linked into a .so lib?

Grant Grundler
parisc-linux {PCI|IOMMU|SMP} hacker
+1.408.447.7253

#3 lore raw
Quoted 1 line · Grant Grundler

Do other arches allow non-PIC .o's to be linked into a .so lib?

Many do. You will get text relocations (indicated by the DT_TEXTREL tag) which render your DSO unsharable.

Signature · 3 lines
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------
#4 lore raw
In reply to Grant Grundler
Quoted 4 lines

Anyway, after spending another two hours on the -fPIC problem, I'm starting to think the xfree86 lib build is broken by design for __hppa__. I'll send out another mail with a patch + recipe for building the libs. I'm pretty close to finding workarounds (not solutions) for the problems.

Did the patches I built to get XFree86 libs building not get as far as you. I sent them to Paul (I believe)

Quoted 1 line

Do other arches allow non-PIC .o's to be linked into a .so lib?

Generally - yes.

#5 lore raw
Quoted 3 lines · Alan Cox
Quoted 1 line

Do other arches allow non-PIC .o's to be linked into a .so lib?

Generally - yes.

True, but it's not recommended. The reason being that non-PIC code in a shared lib will mean lib pages with relocations can't be shared between processes should the library be loaded at a different virtual addresses.

--
Alan Modra

#6 lore raw
In reply to Alan Cox
Quoted 2 lines · Alan Cox

Did the patches I built to get XFree86 libs building not get as far as you. I sent them to Paul (I believe)

nope. On Thursday, paul (Lahaie) forwarded an email from you (Feb 12th) stating you would dig up the patches for him but no patches.I pointed this out to paul but he didn't reply yet. Can you fwd me the patches?

Besides, alot has changed since you built xfree86. But I could use it as guidance.

BTW, I did get the libs to build. I've hacked the Imakefile for libGLU so only the .a gets built. Battling my way through programs directories now. A good test to see if the libs are useful or not (already found the libfreetype.a was missing/stale).
Short notes and diff are on pehc:~grundler/*.xfree86

ta,
grant

Grant Grundler
parisc-linux {PCI|IOMMU|SMP} hacker
+1.408.447.7253

#7 lore raw
Quoted 2 lines

stating you would dig up the patches for him but no patches.I pointed this out to paul but he didn't reply yet. Can you fwd me the patches?

Sent off list