Description: Fix FTBFS with ld --as-needed.
Author: Matthias Klose <doko@ubuntu.com>
Bug-Debian: http://bugs.debian.org/641289
Forwarded: https://issues.apache.org/jira/browse/XALANC-747
Last-Update: 2013-06-18

diff --git b/c/Tests/Makefile.in a/c/Tests/Makefile.in
index a8c7ad4..71813dd 100644
--- Tests/Makefile.in
+++ Tests/Makefile.in
@@ -62,7 +62,7 @@ ThreadTest:  prepare $(XSL_BIN_DIR)/ThreadTest
 
 $(XSL_BIN_DIR)/ThreadTest: ${XSL_OBJ_DIR}/ThreadTest.o 
 	${LINK} $(XSL_BUILD_OPTIONS) ${PLATFORM_LIB_LINK_OPTIONS}  \
-	${EXTRA_LINK_OPTIONS}  $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	${EXTRA_LINK_OPTIONS}  $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 ${XSL_OBJ_DIR}/%.o:$(TESTS_DIR)/Threads/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -70,7 +70,7 @@ Conf: prepare $(XSL_BIN_DIR)/Conf
 
 $(XSL_BIN_DIR)/Conf: ${XSL_OBJ_DIR}/conf.o
 	${LINK} $(XSL_BUILD_OPTIONS) ${PLATFORM_LIB_LINK_OPTIONS}  \
-	${EXTRA_LINK_OPTIONS}  $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	${EXTRA_LINK_OPTIONS}  $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 ${XSL_OBJ_DIR}/%.o:$(TESTS_DIR)/Conf/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -92,7 +92,7 @@ Perf: prepare $(XSL_BIN_DIR)/Perf
 
 $(XSL_BIN_DIR)/Perf: $(PERF_OBJECTS)
 	${LINK} $(XSL_BUILD_OPTIONS) ${PLATFORM_LIB_LINK_OPTIONS}  \
-	${EXTRA_LINK_OPTIONS}  $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	${EXTRA_LINK_OPTIONS}  $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 	
 ${XSL_OBJ_DIR}/%.o:$(TESTS_DIR)/Performance/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
diff --git b/c/samples/Makefile.in a/c/samples/Makefile.in
index 56f1601..1b6cea7 100644
--- samples/Makefile.in
+++ samples/Makefile.in
@@ -88,7 +88,7 @@ ApacheModuleXSLT: prepare $(XSL_LIB_DIR)/mod_xslt$(SHLIBSUFFIX)
 
 $(XSL_LIB_DIR)/mod_xslt$(SHLIBSUFFIX) : $(XSL_OBJ_DIR)/mod_xslt.o
 	$(MAKE_SHARED) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/ApacheModuleXSLT/%.c
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) -I/usr/include/apache/ $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -96,7 +96,7 @@ CompileStylesheet: prepare $(XSL_BIN_DIR)/CompileStylesheet
 
 $(XSL_BIN_DIR)/CompileStylesheet: $(XSL_OBJ_DIR)/CompileStylesheet.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/CompileStylesheet/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -104,7 +104,7 @@ DocumentBuilder: prepare $(XSL_BIN_DIR)/DocumentBuilder
 
 $(XSL_BIN_DIR)/DocumentBuilder: $(XSL_OBJ_DIR)/DocumentBuilder.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/DocumentBuilder/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -112,7 +112,7 @@ EntityResolver: prepare $(XSL_BIN_DIR)/EntityResolver
 
 $(XSL_BIN_DIR)/EntityResolver: $(XSL_OBJ_DIR)/EntityResolver.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/EntityResolver/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -120,7 +120,7 @@ ExternalFunction: prepare $(XSL_BIN_DIR)/ExternalFunction
 
 $(XSL_BIN_DIR)/ExternalFunction: $(XSL_OBJ_DIR)/ExternalFunction.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/ExternalFunction/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -128,7 +128,7 @@ ParsedSourceWrappers: prepare $(XSL_BIN_DIR)/ParsedSourceWrappers
 
 $(XSL_BIN_DIR)/ParsedSourceWrappers: $(XSL_OBJ_DIR)/ParsedSourceWrappers.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/ParsedSourceWrappers/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -136,7 +136,7 @@ SerializeNodeSet: prepare $(XSL_BIN_DIR)/SerializeNodeSet
 
 $(XSL_BIN_DIR)/SerializeNodeSet: $(XSL_OBJ_DIR)/SerializeNodeSet.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/SerializeNodeSet/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -144,7 +144,7 @@ SimpleTransform: prepare $(XSL_BIN_DIR)/SimpleTransform
 
 $(XSL_BIN_DIR)/SimpleTransform: $(XSL_OBJ_DIR)/SimpleTransform.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/SimpleTransform/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -152,7 +152,7 @@ SimpleXPathAPI: prepare $(XSL_BIN_DIR)/SimpleXPathAPI
 
 $(XSL_BIN_DIR)/SimpleXPathAPI: $(XSL_OBJ_DIR)/SimpleXPathAPI.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/SimpleXPathAPI/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -160,7 +160,7 @@ SimpleXPathCAPI: prepare $(XSL_BIN_DIR)/SimpleXPathCAPI
 
 $(XSL_BIN_DIR)/SimpleXPathCAPI: $(XSL_OBJ_DIR)/SimpleXPathCAPI.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/SimpleXPathCAPI/%.c
 	$(CC4) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -168,7 +168,7 @@ StreamTransform: prepare $(XSL_BIN_DIR)/StreamTransform
 
 $(XSL_BIN_DIR)/StreamTransform: $(XSL_OBJ_DIR)/StreamTransform.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/StreamTransform/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<		
 
@@ -176,7 +176,7 @@ TraceListen: prepare $(XSL_BIN_DIR)/TraceListen
 
 $(XSL_BIN_DIR)/TraceListen: $(XSL_OBJ_DIR)/TraceListen.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/TraceListen/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<		
 
@@ -184,7 +184,7 @@ TransformToXercesDOM: prepare $(XSL_BIN_DIR)/TransformToXercesDOM
 
 $(XSL_BIN_DIR)/TransformToXercesDOM: $(XSL_OBJ_DIR)/TransformToXercesDOM.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/TransformToXercesDOM/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<		
 
@@ -192,7 +192,7 @@ UseStylesheetParam: prepare $(XSL_BIN_DIR)/UseStylesheetParam
 
 $(XSL_BIN_DIR)/UseStylesheetParam: $(XSL_OBJ_DIR)/UseStylesheetParam.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/UseStylesheetParam/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<	
 
@@ -200,7 +200,7 @@ XalanTransform: prepare $(XSL_BIN_DIR)/XalanTransform
 
 $(XSL_BIN_DIR)/XalanTransform: $(XSL_OBJ_DIR)/XalanTransform.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/XalanTransform/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -208,7 +208,7 @@ XalanTransformerCallback: prepare $(XSL_BIN_DIR)/XalanTransformerCallback
 
 $(XSL_BIN_DIR)/XalanTransformerCallback: $(XSL_OBJ_DIR)/XalanTransformerCallback.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/XalanTransformerCallback/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
@@ -216,7 +216,7 @@ ThreadSafe: prepare $(XSL_BIN_DIR)/ThreadSafe
 
 $(XSL_BIN_DIR)/ThreadSafe: $(XSL_OBJ_DIR)/ThreadSafe.o
 	$(LINK) $(XSL_BUILD_OPTIONS) $(PLATFORM_LIB_LINK_OPTIONS)  \
-	$(EXTRA_LINK_OPTIONS) $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) $^ -o $@	 $(OTHER_LINK_PARAMETERS)
+	$(EXTRA_LINK_OPTIONS) $^ $(XALAN_LIB) $(ALLLIBS) $(CXXFLAGS) -o $@	 $(OTHER_LINK_PARAMETERS)
 $(XSL_OBJ_DIR)/%.o:$(SAMPLES_DIR)/ThreadSafe/%.cpp
 	$(CC1) $(XSL_BUILD_OPTIONS) -c $(XSL_INCL) $(EXTRA_COMPILE_OPTIONS) -o $@ $<
 
