On FreeBSD amd64 with GCC 4.2.1, dbus-1.1.4 does not compile. The error seen is:
cc -O2 -fno-strict-aliasing -pipe -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Wdeclaration-after-statement -fno-common -pie -Wl,-z -Wl,relro -pthread -o dbus-daemon activation.o bus.o config-parser.o config-parser-common.o connection.o desktop-file.o dir-watch-kqueue.o dispatch.o driver.o expirelist.o policy.o selinux.o services.o signals.o test.o utils.o config-loader-expat.o main.o -L/usr/local/lib /usr/local/lib/libexpat.so ../dbus/.libs/libdbus-convenience.a -pthread -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/lib
/usr/bin/ld: /usr/lib/crt1.o: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/lib/crt1.o: could not read symbols: Bad value
This is caused by the PIE linker flags. If these are removed, dbus compiles just fine. This problem does not affect GCC 3.4.6 on the same platform. I do not believe FreeBSD is the only affected platform. I have seen similar PIE-related errors on RedHat for other projects (e.g. xdm and KDE).
Have you tried the latest 1.1.20 or from GIT? We fixed some errors showing up in the new gcc.
No, the build is still broken in the same way. The problem has to do with the PIE flags.
After talking it over with a gcc developer I have come to the conclusion this is a FreeBSD GCC bug which should be fixed there. -pie should be the norm these days especially in such a system sensitive daemon. I do not wish to make it configurable upstream and accidentally have this important security measure turned off on other platforms. Please file a bug upstream and patch it out in the meantime. Thanks.