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.
]]>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)
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
]]>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.
]]>