Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

build: 3rd party lib linking symbols cleanup

Fix several linking concerns that are usually masked in one way or another.
To see, add -Wl,--unresolved-symbols=ignore-in-shared-libs to LDFLAGS

1. The 3rd party libs that we build can't resolve our wrapped functions until
   runtime, so tell the linker not to expect them.
2. Various vis and screensavers were relying on XBMC bringing in GL libs.

With these fixes, linking opts like --unresolved-symbols=ignore-in-shared-libs
now work properly. This is useful for annoying libs like gles or egl which
may depend on other libs that cannot resolve at link-time.

TODO: ProjectM still neeeds attention
  • Loading branch information...
commit 493650feac5c2143d33cd527536797b1c8b3db6c 1 parent 4511eb1
theuni authored
View
2  lib/cximage-6.0/Makefile.in
@@ -22,7 +22,7 @@ ifeq ($(findstring osx,$(ARCH)), osx)
@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o CxImage/*.o jasper/*/*.o jbig/*.o raw/*.o
else
$(CXX) $(CFLAGS) $(LDFLAGS) -shared -o $(SLIB) -Wl,--whole-archive $(SLIBS) \
- -Wl,--no-whole-archive -lpng -ljasper -ljpeg -ltiff -lz \
+ -Wl,--no-whole-archive -lpng -ljasper -ljpeg -ltiff -lz -Wl,--unresolved-symbols=ignore-all \
`cat ../../xbmc/cores/DllLoader/exports/wrapper.def` \
../../xbmc/cores/DllLoader/exports/wrapper.o
endif
View
3  lib/libdvd/Makefile.in
@@ -56,11 +56,12 @@ else
$(SYSDIR)/libdvdcss-$(ARCH).so: $(WRAPPER) libdvdcss/src/.libs/libdvdcss.a
$(CC) -o $@ $(LDFLAGS) -Wl,--soname,$@ \
- libdvdcss/src/*.o \
+ libdvdcss/src/*.o -Wl,--unresolved-symbols=ignore-all \
`cat $(WRAPPER:.o=.def)` $(WRAPPER)
$(SYSDIR)/libdvdnav-$(ARCH).so: $(WRAPPER) $(DVDCSS_A) libdvdread/obj/libdvdread.a libdvdnav/obj/libdvdnav.a
$(CC) -o $@ $(LDFLAGS) -Wl,--soname,$@ $(DVDCSS_O) libdvdread/obj/*.o libdvdnav/obj/*.o \
+ -Wl,--unresolved-symbols=ignore-all \
`cat $(WRAPPER:.o=.def)` $(WRAPPER)
endif
View
2  lib/libexif/Makefile.in
@@ -14,7 +14,7 @@ ifeq ($(findstring osx,$(ARCH)), osx)
-bundle -undefined dynamic_lookup -read_only_relocs suppress -o $@ \
@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS)
else
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) \
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) -Wl,--unresolved-symbols=ignore-all \
`cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
endif
View
3  lib/libhdhomerun/Makefile.in
@@ -24,7 +24,8 @@ ifeq ($(findstring osx,$(ARCH)), osx)
-bundle -undefined dynamic_lookup -read_only_relocs suppress -o $@ \
@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS)
else
- $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -shared -o $@ `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` \
+ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -shared -o $@ -Wl,--unresolved-symbols=ignore-all \
+ `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` \
@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
endif
View
2  lib/libid3tag/Makefile.in
@@ -16,7 +16,7 @@ $(SLIB): libid3tag/.libs/libid3tag.dylib
chmod +x $@
else
$(SLIB): libid3tag/.libs/libid3tag.so
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -fPIC -o $@ libid3tag/.libs/*.o \
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -fPIC -Wl,--unresolved-symbols=ignore-all -o $@ libid3tag/.libs/*.o \
`cat ../../xbmc/cores/DllLoader/exports/wrapper.def` \
../../xbmc/cores/DllLoader/exports/wrapper.o
endif
View
3  lib/libsidplay2/Makefile.in
@@ -57,7 +57,8 @@ ifeq ($(findstring osx,$(ARCH)), osx)
-bundle -undefined dynamic_lookup -read_only_relocs suppress -o $@ \
@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS) $(BUNDLE1_O)
else
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) -Wl,--unresolved-symbols=ignore-all \
+ `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
endif
include @abs_top_srcdir@/Makefile.include
View
3  lib/nosefart/Makefile.in
@@ -31,7 +31,8 @@ ifeq ($(findstring osx,$(ARCH)), osx)
-bundle -undefined dynamic_lookup -read_only_relocs suppress -o $@ \
@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS) $(BUNDLE1_O)
else
- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) -Wl,--unresolved-symbols=ignore-all \
+ `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
endif
include @abs_top_srcdir@/Makefile.include
View
2  lib/snesapu/SNES/SNESAPU/Makefile.in
@@ -21,7 +21,7 @@ ifeq ($(findstring osx,$(ARCH)), osx)
-bundle -undefined dynamic_lookup -read_only_relocs suppress -o $@ \
@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS)
else
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) \
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) -Wl,--unresolved-symbols=ignore-all \
`cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
endif
View
3  lib/stsound/StSoundLibrary/Makefile.in
@@ -24,7 +24,8 @@ ifeq ($(findstring osx,$(ARCH)), osx)
-bundle -undefined dynamic_lookup -read_only_relocs suppress -o $@ \
@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS) $(BUNDLE1_O)
else
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) -Wl,--unresolved-symbols=ignore-all \
+ `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
endif
include @abs_top_srcdir@/Makefile.include
View
3  lib/timidity/Makefile.in
@@ -56,7 +56,8 @@ ifeq ($(findstring osx,$(ARCH)), osx)
$(CXX) $(LDFLAGS) -Wl,-alias_list,@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper_mach_alias -bundle \
-undefined dynamic_lookup -read_only_relocs suppress -o $@ @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS) $(BUNDLE1_O)
else
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o -Wl,--version-script=exports.def
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) -Wl,--unresolved-symbols=ignore-all `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` \
+ @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o -Wl,--version-script=exports.def
endif
include @abs_top_srcdir@/Makefile.include
View
3  lib/vgmstream/Makefile.in
@@ -199,7 +199,8 @@ ifeq ($(findstring osx,$(ARCH)), osx)
-bundle -undefined dynamic_lookup -read_only_relocs suppress -o $@ \
@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS) $(BUNDLE1_O)
else
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(OBJS) -Wl,--unresolved-symbols=ignore-all \
+ `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
endif
View
3  lib/xbadpcm/Makefile.in
@@ -12,7 +12,8 @@ ifeq ($(findstring osx,$(ARCH)), osx)
@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o *.o $(BUNDLE1_O)
chmod +x $@
else
- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ *.o `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ *.o -Wl,--unresolved-symbols=ignore-all \
+ `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
endif
include @abs_top_srcdir@/Makefile.include
View
6 xbmc/screensavers/rsxs-0.9/xbmc/Makefile.in
@@ -28,7 +28,7 @@ ifeq ($(findstring osx,$(ARCH)), osx)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -flat_namespace -undefined dynamic_lookup \
-o $(SOLARWINDS-OUT) $(RSXS)/src/solarwinds/*.o $(RSXS-OBJS)
else
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(SOLARWINDS-OUT) $(RSXS)/src/solarwinds/*.o $(RSXS-OBJS) -lXmu
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(SOLARWINDS-OUT) $(RSXS)/src/solarwinds/*.o $(RSXS-OBJS) -lXmu -lGL -lX11 -lGLU
endif
$(PLASMA-OUT): $(PLASMA-DEP)
@@ -36,7 +36,7 @@ ifeq ($(findstring osx,$(ARCH)), osx)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -flat_namespace -undefined dynamic_lookup \
-o $(PLASMA-OUT) $(RSXS)/src/plasma/*.o $(RSXS-OBJS)
else
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(PLASMA-OUT) $(RSXS)/src/plasma/*.o $(RSXS-OBJS) -lXmu
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(PLASMA-OUT) $(RSXS)/src/plasma/*.o $(RSXS-OBJS) -lXmu -lGL -lX11 -lGLU
endif
$(EUPHORIA-OUT): $(EUPHORIA-DEP)
@@ -44,7 +44,7 @@ ifeq ($(findstring osx,$(ARCH)), osx)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -flat_namespace -undefined dynamic_lookup \
-o $(EUPHORIA-OUT) $(RSXS)/src/euphoria/*.o $(RSXS)/src/pngimage.o $(RSXS-OBJS) -lpng
else
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(EUPHORIA-OUT) $(RSXS)/src/euphoria/*.o $(RSXS)/src/pngimage.o $(RSXS-OBJS) -lXmu -lpng
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(EUPHORIA-OUT) $(RSXS)/src/euphoria/*.o $(RSXS)/src/pngimage.o $(RSXS-OBJS) -lXmu -lpng -lGL -lX11 -lGLU
endif
$(SOLARWINDS-DEP) : $(RSXS)
View
2  xbmc/visualizations/OpenGLSpectrum/Makefile.in
@@ -7,9 +7,11 @@ SLIB=@abs_top_srcdir@/addons/visualization.glspectrum/opengl_spectrum.vis
ifeq (@USE_OPENGLES@,1)
OBJS+=../EGLHelpers/Shader.o ../EGLHelpers/GUIShader.o ../../guilib/MatrixGLES.o
DEFINES+=-DHAS_GLES
+ LDFLAGS+=-lGLESv2
else
DEFINES+=-DHAS_SDL
DEFINES+=-DHAS_SDL_OPENGL
+ LDFLAGS+=-lGL
endif
$(SLIB): $(OBJS)
View
2  xbmc/visualizations/WaveForm/Makefile.in
@@ -8,8 +8,10 @@ SLIB=@abs_top_srcdir@/addons/visualization.waveform/Waveform.vis
ifeq (@USE_OPENGLES@,1)
OBJS=Main_gles.o ../EGLHelpers/Shader.o ../EGLHelpers/GUIShader.o ../../guilib/MatrixGLES.o
DEFINES+=-DHAS_GLES
+ LDFLAGS+=-lGLESv2
else
DEFINES+=-DHAS_SDL_OPENGL
+ LDFLAGS+=-lGL -lGLU
endif
$(SLIB): $(OBJS)
Please sign in to comment.
Something went wrong with that request. Please try again.