You are not logged in.
Many posts around here showing that this is a common problem. ld has changed behaviour and has broken some packages that don't explicitly link to libraries.
My example: Minutor
gcc -Wl,--as-needed -o minutor minutor.o mapviewer.o colorschemes.o `pkg-config --libs gtk+-2.0` MinutorMap/MinutorMap.a
/usr/bin/ld: MinutorMap/MinutorMap.a(nbt.o): undefined reference to symbol 'gzopen'
/usr/bin/ld: note: 'gzopen' is defined in DSO /usr/lib/libz.so.1 so try adding it to the linker command line
/usr/lib/libz.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [minutor] Error 1
Related info I found on the Fedora Wiki
All posts so far suggest adding things to LDFLAGS but none of them have worked for me yet. Found on thread "EMC2 Simulator (CNC) PKGBUILD":
--as-needed isn't the problem here, it's transitive linking. See the first item in the ld changelog for binutils 2.22. There's two options:
- add "-Wl,--copy-dt-needed-entries" to LDFLAGS
- add "-lXt" to LDFLAGSEither way, this should be fixed upstream. You should explicitly link against any library you depend on.
This didn't work for me whether I put it in the PKGBUILD or /etc/makepkg.conf
Any ideas?
EDIT: It appears that the LDFLAGS are not being added to the gcc line shown above no matter where I put the additional LDFLAGS. Perhaps I'm doing it wrong.
Last edited by quantumphaze (2012-02-08 07:32:11)
▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▏▎▍▌▋▊▉█▇▆▅▄▃▂▁
Offline
EDIT: It appears that the LDFLAGS are not being added to the gcc line shown above no matter where I put the additional LDFLAGS. Perhaps I'm doing it wrong.
Kinda hard to figure that out without you showing what you're doing. And whatever it is, you should always nag upstream to fix their assumptions on compilation and ld.
P.S. - OT - I've got 99 AUR packages installed and this problem doesn't show up on any of them, so I'm not sure what 'common' means in your case
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
P.S. - OT - I've got 99 AUR packages installed and this problem doesn't show up on any of them, so I'm not sure what 'common' means in your case
I maintain one package in AUR and it hit this issue. From this I extrapolate that every AUR package is broken
Anyway, patch for minutor:
--- minutor.orig/Makefile 2011-05-21 08:34:22.000000000 +0200
+++ minutor/Makefile 2012-02-08 11:15:13.682083948 +0100
@@ -16,7 +16,7 @@
all: $(EXEC)
$(EXEC): $(OBJS) maplib
- $(CC) -Wl,--as-needed -o $(EXEC) $(OBJS) $(LIBS) MinutorMap/MinutorMap.a
+ $(CC) -Wl,--as-needed -o $(EXEC) $(OBJS) $(LIBS) MinutorMap/MinutorMap.a -lz
install: $(EXEC)
install -d $(BIN) $(DESKTOP) $(PIXMAP)
Last edited by Gusar (2012-02-08 10:14:44)
Offline
I found 3 other threads with similar problems (search for "dso") and just assumed that most people were going to wait and see if it gets fixed in a few days.
What I was trying to do before:
Tried adding to the PHGBUILD both outside and inside the build() function, with and without quotes and -Wl
LDFLAGS="-Wl,--copy-dt-needed-entries"
LDFLAGS="$(LDFLAGS) -Wl,--copy-dt-needed-entries"
and appending ,--copy-dt-needed-entries to the LDFLAGS line in /etc/makepkg.conf
I will go complain to upstream now since the maintainer probably doesn't know.
▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▏▎▍▌▋▊▉█▇▆▅▄▃▂▁
Offline
Playing with LDFLAGSS won't do anything here, as Minutor uses a simple Makefile for building and this Makefile does not take into account the LFDFLAGS variable. So the right fix here is to just add the linker flags directly into the Makefile.
Offline