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

Bug#1033211: clp: configure script misdetects tons of things



Source: clp
Version: 1.17.6-3
Severity: important
User: debian-cross@lists.debian.org
Usertags: ftcbfs

Hi,

I happened to look into a clp cross build failure, but what I found was
more problems. If you look at configure output, you see this:

| checking whether the compiler supports GNU C... no
| checking whether gcc accepts -g... no
| checking for gcc option to enable C11 features... unsupported
| checking for gcc option to enable C99 features... unsupported
| checking for gcc option to enable C89 features... unsupported

Quite obviously, this is all wrong and autoconf will turn on quite a bit
of barely tested workarounds due to these misdetections.

So I looked into why this happens and ultimately, all of these use
ac_fn_c_try_compile and they all say "$? = 0" followed by "failed
program" in config.log. So compilation was successful, but it was
treated as failure, because conftest.$ac_objext didn't exist. As it
happens, ac_objext is undefined, because _AC_COMPILER_OBJEXT hasn't been
run yet. It gets run later and then ac_fn_c_try_compile actually works,
but when these tests are rerun, their cached values are used.

I looked into the m4 files to see why this would happen, but I ended up
not identifying the cause. However, if you export ac_objext=o,
ac_fn_c_try_compile actually works and these things get correctly
detected. As it happens, this also fixes cross compilation, but really
the misdetections are a problem and should be fixed even for native
builds. I'm attaching a patch that works around the issue by setting
ac_objext, but I hope you can find a better solution.

Helmut
diff --minimal -Nru clp-1.17.6/debian/changelog clp-1.17.6/debian/changelog
--- clp-1.17.6/debian/changelog	2022-11-27 05:27:26.000000000 +0100
+++ clp-1.17.6/debian/changelog	2023-03-19 19:40:11.000000000 +0100
@@ -1,3 +1,9 @@
+clp (1.17.6-4) UNRELEASED; urgency=medium
+
+  * Work around severe configure misdetections. (Closes: #-1)
+
+ -- Helmut Grohne <helmut@subdivi.de>  Sun, 19 Mar 2023 19:40:11 +0100
+
 clp (1.17.6-3) unstable; urgency=medium
 
   * QA upload.
diff --minimal -Nru clp-1.17.6/debian/rules clp-1.17.6/debian/rules
--- clp-1.17.6/debian/rules	2022-11-27 05:27:26.000000000 +0100
+++ clp-1.17.6/debian/rules	2023-03-19 19:40:11.000000000 +0100
@@ -9,7 +9,10 @@
 	dh_autoreconf autoreconf -- --force --install --no-recursive --include=BuildTools
 
 override_dh_auto_configure:
-	dh_auto_configure -- --enable-static --enable-dot --enable-dependency-linking
+	# The configure script is broken as it uses ac_fn_c_try_compile before
+	# having run _AC_COMPILER_OBJEXT, so supply ac_objext to make it barely
+	# work.
+	ac_objext=o dh_auto_configure -- --enable-static --enable-dot --enable-dependency-linking
 
 override_dh_auto_build:
 	dh_auto_build

Reply to: