id summary reporter owner description type status priority milestone component version resolution keywords cc device_name 156 build on sparc fails due to missing -fPIC in external/libconfig sobukus ppalmers Build of http://subversion.ffado.org/ffado/branches/libffado-2.0 on (rev 1319) x86-64 with PIC enabled in CFLAGS fails with this:\r\n\r\ngcc -o external/libconfig/grammar.o -c -DDEBUG -Wall -g -m64 -DDEBUG -Wall -g -DDBUS_HAS_THREADS_INIT_DEFAULT -m64 -Iexternal/libconfig external/libconfig/grammar.c\r\ngcc -o external/libconfig/libconfig.o -c -DDEBUG -Wall -g -m64 -DDEBUG -Wall -g -DDBUS_HAS_THREADS_INIT_DEFAULT -m64 -Iexternal/libconfig external/libconfig/libconfig.c\r\ng++ -o external/libconfig/libconfigcpp.o -c -DDEBUG -Wall -g -DDBUS_HAS_THREADS_INIT_DEFAULT -m64 -Iexternal/libconfig external/libconfig/libconfigcpp.cpp\r\ngcc -o external/libconfig/scanner.o -c -DDEBUG -Wall -g -m64 -DDEBUG -Wall -g -DDBUS_HAS_THREADS_INIT_DEFAULT -m64 -Iexternal/libconfig external/libconfig/scanner.c\r\nscanner.c:1527: warning: 'input' defined but not used\r\nar rc external/libconfig/libconfigpp.a external/libconfig/grammar.o external/libconfig/libconfig.o external/libconfig/libconfigcpp.o external/libconfig/scanner.o\r\nranlib external/libconfig/libconfigpp.a\r\ng++ -o src/libffado.so -shared [ lots of objects ] -Lexternal/libconfig -lconfigpp [ lots of libs ]\r\n/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/../../../../x86_64-pc-linux-gnu/bin/ld: external/libconfig/libconfigpp.a(libconfigcpp.o): relocation R_X86_64_32S against `vtable for libconfig::SettingException' can not be used when making a shared object; recompile with -fPIC\r\nexternal/libconfig/libconfigpp.a: could not read symbols: Bad value\r\ncollect2: ld returned 1 exit status\r\nscons: *** [src/libffado.so] Error 1\r\nscons: building terminated because of errors.\r\n ! Problem Detected ! \r\n\r\nThe trouble originates in the build of external/libconfig/libconfigpp.a as a static library and then trying to incorporate that into a shared library.\r\nSCons disables the -fPIC flag (which is included in environment CFLAGS) for the build of a static library.\r\nWhen I hack the corresponding SCons config file in external/libconfig to force -fPIC on CFLAGS the build completes fine.\r\nSomething like that in external/libconfig/SConscript:\r\n\r\nenv.AppendUnique( CCFLAGS=["-fPIC"] )\r\n\r\nThis may not be needed on x86, but it is for x86-64 where you should always compile with PIC (this will apply to alpha arch, too, most probably -- yes I still have such a thing and playfully think about trying firewire with it;-).\r\n\r\nSo, is there a clean way to just make SCons honour the given -fPIC in CFLAGS, even for the static library (that is going to be part of a dynamic library)?\r\nOtherwise I'll have to hack our (Source Mage GNU/Linux) build scripts to patch in the -fPIC for external/libconfig/libconfigpp.a in case we build for a x86-64 box.\r\n\r\n bug closed minor FFADO 2.1 FFADO 2.0-beta6 (1.999.36) wontfix