public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Goth <Andrew.Goth@caemilusa.com>
To: "binutils@sourceware.org" <binutils@sourceware.org>
Subject: @CPP_FOR_BUILD@ problem since binutils-2.38
Date: Fri, 7 Oct 2022 04:10:07 +0000	[thread overview]
Message-ID: <PH1P110MB16505D9D39EC5B1DE22FE3D5EC5F9@PH1P110MB1650.NAMP110.PROD.OUTLOOK.COM> (raw)

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.

             reply	other threads:[~2022-10-07  4:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-07  4:10 Andrew Goth [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH1P110MB16505D9D39EC5B1DE22FE3D5EC5F9@PH1P110MB1650.NAMP110.PROD.OUTLOOK.COM \
    --to=andrew.goth@caemilusa.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).