Idwer Vollering (vidwer@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2342
-gerrit
commit ff4411b82cb4c18b9aaaec160bc0f1c5fcb5ee2c Author: Idwer Vollering vidwer@gmail.com Date: Fri Mar 27 00:15:20 2015 +0100
crossgcc: don't use libdl while building GDB on FreeBSD
Since FreeBSD doesn't have libdl, these errors are shown: - config.log: /usr/bin/ld: cannot find -ldl - crossgcc-build.log: configure: error: C compiler cannot create executables
Conditionally pass the presence of libdl in LDFLAGS.
Change-Id: I79c48da7e6700a4606c9e0c1314241db8997d3f3 Signed-off-by: Idwer Vollering vidwer@gmail.com --- util/crossgcc/buildgcc | 5 ++++- util/genbuild_h/genbuild_h.sh | 24 +++++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index fde8bc6..76ab936 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -583,8 +583,11 @@ printf "Building GDB ${GDB_VERSION} ... " cd ${BUILDDIRPREFIX}-gdb export PYTHONHOME=$DESTDIR$TARGETDIR rm -f .failed + if [ $(uname) != "FreeBSD" -a $(uname) != "NetBSD" ]; then + LIBDL="-ldl" + fi LDFLAGS="-Wl,-rpath,$$ORIGIN/../lib/ -L$DESTDIR$TARGETDIR/lib \ - -lpthread -ldl -lutil" \ + -lpthread $LIBDL -lutil" \ CC="$CC" CFLAGS="$HOSTCFLAGS -I$DESTDIR$TARGETDIR/include" \ ../gdb-${GDB_VERSION}/configure --prefix=$TARGETDIR \ --target=${TARGETARCH} --disable-werror --disable-nls diff --git a/util/genbuild_h/genbuild_h.sh b/util/genbuild_h/genbuild_h.sh index b161dff..55a3b85 100755 --- a/util/genbuild_h/genbuild_h.sh +++ b/util/genbuild_h/genbuild_h.sh @@ -31,6 +31,16 @@ else DATE=$(date +%s) fi
+our_date() { +case $(uname) in +NetBSD|OpenBSD|DragonFly|FreeBSD) + TZ=UTC date -r $1 $2 + ;; +*) + TZ=UTC date -d @$1 $2 +esac +} + #Print out the information that goes into build.h printf "/* build system definitions (autogenerated) */\n" printf "#ifndef __BUILD_H\n" @@ -43,12 +53,12 @@ printf "#define COREBOOT_VERSION_TIMESTAMP $DATE\n" printf "#define COREBOOT_ORIGIN_GIT_REVISION "$GITREV"\n"
printf "#define COREBOOT_EXTRA_VERSION "%s"\n" "$COREBOOT_EXTRA_VERSION" -printf "#define COREBOOT_BUILD "%s"\n" "$(LANG= TZ=UTC date -d @$DATE)" -printf "#define COREBOOT_BUILD_YEAR_BCD 0x%s\n" "$(TZ=UTC date -d @$DATE +%y)" -printf "#define COREBOOT_BUILD_MONTH_BCD 0x%s\n" "$(TZ=UTC date -d @$DATE +%m)" -printf "#define COREBOOT_BUILD_DAY_BCD 0x%s\n" "$(TZ=UTC date -d @$DATE +%d)" -printf "#define COREBOOT_BUILD_WEEKDAY_BCD 0x%s\n" "$(TZ=UTC date -d @$DATE +%w)" -printf "#define COREBOOT_DMI_DATE "%s"\n" "$(TZ=UTC date -d @$DATE +%m/%d/%Y)" +printf "#define COREBOOT_BUILD "$(LANG= our_date "$DATE")"\n" +printf "#define COREBOOT_BUILD_YEAR_BCD 0x$(our_date "$DATE" +%y)\n" +printf "#define COREBOOT_BUILD_MONTH_BCD 0x$(our_date "$DATE" +%m)\n" +printf "#define COREBOOT_BUILD_DAY_BCD 0x$(our_date "$DATE" +%d)\n" +printf "#define COREBOOT_BUILD_WEEKDAY_BCD 0x$(our_date "$DATE" +%w)\n" +printf "#define COREBOOT_DMI_DATE "$(our_date "$DATE" +%m/%d/%Y)"\n" printf "\n" -printf "#define COREBOOT_COMPILE_TIME "%s"\n" "$(TZ=UTC date -d @$DATE +%T)" +printf "#define COREBOOT_COMPILE_TIME "$(our_date "$DATE" +%T)"\n" printf "#endif\n"