Files
buildroot/package/sdl_mixer/0002-add-LDFLAGS-while-linking.patch
2019-09-25 20:52:32 -03:00

36 lines
2.1 KiB
Diff

Pass LDFLAGS while creating binaries.
Fixes following linking error with uClibc-ng:
br/output/host/usr/lib/gcc/powerpc-buildroot-linux-uclibc/5.4.0/libgcc.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
br/output/build/host-gcc-final-5.4.0/build/powerpc-buildroot-linux-uclibc/libgcc/../../../libgcc/unwind-dw2-fde-dip.c:465: undefined reference to `dl_iterate_phdr'
collect2: error: ld returned 1 exit status
Since uClibc-ng 1.0.18 a circular dependency between libc and libgcc
exist, when static linking is used. It can be resolved by the compiler
when -static is correctly passed in the linking step.
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Revised patch so it would also work with SDL_mixer 1.2.13
diff -Nur SDL_mixer-1.2.13.orig/Makefile.in SDL_mixer-1.2.13/Makefile.in
--- SDL_mixer-1.2.13.orig/Makefile.in 2012-01-15 23:01:04.000000000 +0100
+++ SDL_mixer-1.2.13/Makefile.in 2016-12-07 08:29:22.479786596 +0100
@@ -63,13 +63,13 @@
.PHONY: all install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist
$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
- $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(SDL_LIBS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
+ $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(SDL_LIBS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
$(objects)/playwave$(EXE): $(objects)/playwave.lo $(objects)/$(TARGET)
- $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(LDFLAGS) $(objects)/$(TARGET)
+ $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(LDFLAGS) $(LDFLAGS) $(objects)/$(TARGET)
$(objects)/playmus$(EXE): $(objects)/playmus.lo $(objects)/$(TARGET)
- $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playmus.lo $(SDL_CFLAGS) $(SDL_LIBS) $(LDFLAGS) $(objects)/$(TARGET)
+ $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playmus.lo $(SDL_CFLAGS) $(SDL_LIBS) $(LDFLAGS) $(LDFLAGS) $(objects)/$(TARGET)
install: all install-hdrs install-lib #install-bin
install-hdrs: