public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* @CPP_FOR_BUILD@ problem since binutils-2.38
@ 2022-10-07  4:10 Andrew Goth
  2022-10-07  8:42 ` Jan Beulich
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Goth @ 2022-10-07  4:10 UTC (permalink / raw)
  To: binutils

Hi, I'm having trouble with @CPP_FOR_BUILD@, @CPPFLAGS_FOR_BUILD@, etc. in binutils's Makefile.in not being replaced by the configure script.

This problem was introduced with version 2.38 and persists into 2.39.

Here is an excerpt from the diff from 2.37 to 2.38:

diff -U0 -r binutils-2.37/Makefile.in binutils-2.38/Makefile.in
--- binutils-2.37/Makefile.in   2021-07-18 11:47:23.000000000 -0500
+++ binutils-2.38/Makefile.in   2022-02-09 06:04:43.000000000 -0600
@@ -342,0 +367,2 @@
+CPP_FOR_BUILD = @CPP_FOR_BUILD@
+CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
@@ -345,0 +372 @@
+DSYMUTIL_FOR_BUILD = @DSYMUTIL_FOR_BUILD@
@@ -347,0 +375 @@
+GDC_FOR_BUILD = @GDC_FOR_BUILD@
@@ -394,0 +423 @@
+DSYMUTIL = @DSYMUTIL@
@@ -398,0 +428 @@
+OTOOL = @OTOOL@
@@ -404,0 +435 @@
+GDC = @GDC@

Every single one of these additions to Makefile.in yields a corresponding Makefile line that passes through unsubstituted.

In configure, CPP_FOR_BUILD, etc. aren't in $ac_subst_vars. Similarly, they're not listed with AC_SUBST() in configure.ac, which I find most interesting.

This breaks my script for building binutils, gcc, etc. as a cross compiler. The problem makes itself known during configure-isl. I embed isl-0.25 into binutils's isl subdirectory, and it chokes due to the CPP_FOR_BUILD environment variable coming in as literally @CPP_FOR_BUILD@. My successful workaround has been to stick with binutils-2.37, but I can't stay behind forever.

configure:5762: checking whether the C compiler works
configure:5784: gcc -g -O2 @CPPFLAGS_FOR_BUILD@  conftest.c  >&5
/usr/bin/ld: cannot find @CPPFLAGS_FOR_BUILD@: No such file or directory
collect2: error: ld returned 1 exit status

I'm building using a fresh Slackware64 15.0 install, and I'm not applying any patches to binutils or isl.

To double-check whether it's me or there really is something funny going on, as well as to give you a reproducible test case I had no hand in writing (ruling out operator error on my part), I ran Slackware's own build script for binutils, with an "exit" immediately following the configure script. This leaves me with @CPP_FOR_BUILD@ literally appearing in /tmp/binutils-2.39/Makefile, consistent with my own experience.

If you want to follow along, here is the process:
(1) get https://mirrors.slackware.com/slackware/slackware-iso/slackware64-15.0-iso/slackware64-15.0-install-dvd.iso
(2) install onto a VM
(3) boot and log in (root is fine)
(4) wget -np -r -R '*.mirrorlist' -R 'index.html*' https://mirrors.slackware.com/slackware/slackware-current/source/d/binutils/
(5) edit binutils.SlackBuild to add "exit" after the configure command
(6) run binutils.SlackBuild
(7) find the results in /tmp/binutils-2.39

If it weren't for the exit, this would result in a good binutils build, since @CPP_FOR_BUILD@, etc. don't affect this configuration. But try building binutils with an in-tree isl and you'll have trouble due to isl's configure script looking at $CPP_FOR_BUILD.

I'm considering experimenting with adding more AC_SUBST() lines to configure.ac, downgrading to autoconf 2.69, and regenerating configure. Alas, the hour grows late and I have other projects I must complete tonight, so I decided to write up this email and move on.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-10-13  4:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-07  4:10 @CPP_FOR_BUILD@ problem since binutils-2.38 Andrew Goth
2022-10-07  8:42 ` Jan Beulich
2022-10-10  0:43   ` Alan Modra
2022-10-10  6:50     ` Tsukasa OI
2022-10-11 13:03       ` Alan Modra
2022-10-11 18:21     ` Tom Tromey
2022-10-11 23:40       ` Alan Modra
2022-10-13  4:32         ` Tom Tromey
2022-10-10 10:06   ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).