[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#789499: busybox: FTBFS with clang instead of gcc

Source: busybox
Version: 1.22.0
Severity: minor

Dear Maintainer,


Using the rebuild infrastructure, your package fails to build with clang instead of gcc.

The error message is like this:
>>debianutils/lib.a(mktemp.o): In function `mktemp_main':
>>/home/builder/workspace/busybox/busybox-1.22.0/build/udeb/debianutils/mktemp.c:96: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
>>archival/lib.a(tar.o): In function `tar_main':
>>/home/builder/workspace/busybox/busybox-1.22.0/build/udeb/archival/tar.c:1180: undefined reference to `unpack_Z_stream'
>>/usr/bin/ld: busybox_unstripped: hidden symbol `unpack_Z_stream' isn't defined
>>/usr/bin/ld: final link failed: Bad value
>>clang: error: linker command failed with exit code 1 (use -v to see invocation)

I found this is because of one recipe's dependency wasn't satisfied when
building this package with clang. I found a similar case here http://lists.busybox.net/pipermail/busybox/2013-January/078871.html.
But changing optimization level which was mentioned in this thread wasn't
worked for this package. So I fixed it by simply add a conditional statement
in makefile to deal with this difference.

Many thanks,

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.0.5-1-ARCH (SMP w/8 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect
diff -Nru busybox-1.22.0/debian/patches/clang_built.patch busybox-1.22.0/debian/patches/clang_built.patch
--- busybox-1.22.0/debian/patches/clang_built.patch	1970-01-01 00:00:00.000000000 +0000
+++ busybox-1.22.0/debian/patches/clang_built.patch	2015-06-05 11:10:25.000000000 +0000
@@ -0,0 +1,12 @@
+--- a/archival/libarchive/Kbuild.src
++++ b/archival/libarchive/Kbuild.src
+@@ -45,6 +45,9 @@
+ lib-$(CONFIG_AR)                        += get_header_ar.o unpack_ar_archive.o
+ lib-$(CONFIG_CPIO)                      += get_header_cpio.o
+ lib-$(CONFIG_TAR)                       += get_header_tar.o
++ifeq ($(shell $(CC) --version | grep -c "clang version"),1)
++lib-$(CONFIG_TAR)                       += get_header_tar.o decompress_uncompress.o
+ lib-$(CONFIG_FEATURE_TAR_TO_COMMAND)    += data_extract_to_command.o
+ lib-$(CONFIG_LZOP)                      += lzo1x_1.o lzo1x_1o.o lzo1x_d.o
+ lib-$(CONFIG_LZOP_COMPR_HIGH)           += lzo1x_9x.o
diff -Nru busybox-1.22.0/debian/patches/series busybox-1.22.0/debian/patches/series
--- busybox-1.22.0/debian/patches/series	2015-03-04 16:02:27.000000000 +0000
+++ busybox-1.22.0/debian/patches/series	2015-06-05 11:08:37.000000000 +0000
@@ -29,3 +29,4 @@

Reply to: