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

Bug#787071: libffi: FTBFS with clang instead of gcc



Source: libffi
Version: 3.1
Severity: minor

Dear Maintainer,

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

Error message is:
clang: error: unsupported argument '--gdwarf2' to option 'Wa,'

Full build log is available here:
http://clang.debian.net/logs/2015-01-23/libffi_3.1-2_unstable_clang.log

Thanks,
Joseph

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

Kernel: Linux 4.0.4-2-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
diff -Nru libffi-3.1/debian/rules libffi-3.1/debian/rules
--- libffi-3.1/debian/rules	2014-06-04 13:28:42.000000000 +0000
+++ libffi-3.1/debian/rules	2015-05-26 02:19:36.000000000 +0000
@@ -45,7 +45,10 @@
 		--prefix=/usr \
 		--mandir=\$${prefix}/share/man \
 		--infodir=\$${prefix}/share/info \
-		CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CCASFLAGS="$(CFLAGS) -Wa,--gdwarf2" LDFLAGS="-Wl,-z,defs $(LDFLAGS)"
+		CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs $(LDFLAGS)" \
+# clang doesn't accept --gdwarf2, it should be -gdwarf-2
+		if [ `${CC} -v 2>&1 | grep -c "clang version"` -eq 1 ]; then CCASFLAGS="$(CFLAGS) -Wa,-gdwarf-2"; \
+		else CCASFLAGS="$(CFLAGS) -Wa,--gdwarf2"; fi
 	touch $@
 #		--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
 

Reply to: