Bug 34211 - Wrong preprocessor called in build-i686-cygwin/libiberty/configure
Summary: Wrong preprocessor called in build-i686-cygwin/libiberty/configure
Status: WAITING
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.2.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2007-11-24 00:12 UTC by Esben Haabendal
Modified: 2021-08-24 06:55 UTC (History)
1 user (show)

See Also:
Host: ppc603e-linux-gcc
Target: ppc603e-linux-gcc
Build: i686-cygwin_nt_5.1
Known to work:
Known to fail:
Last reconfirmed: 2021-08-24 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Esben Haabendal 2007-11-24 00:12:10 UTC
When configure is called in the build-i686-cygwin/libiberty subdir, CC is set correctly to build gcc, but CPP is inherited as "powerpc-linux-gcc -E".

It seems like we should be setting CPP to "${CC_FOR_BUILD} -E" in all the places where CC is set to ${CC_FOR_BUILD}.

diff -urN gcc-4.2.2-orig/Makefile.in gcc-4.2.2/Makefile.in
--- gcc-4.2.2-orig/Makefile.in  2007-11-23 14:22:43.000000000 +0100
+++ gcc-4.2.2/Makefile.in       2007-11-23 15:27:04.809090200 +0100
@@ -113,6 +113,7 @@
        AS="$(AS_FOR_BUILD)"; export AS; \
        CC="$(CC_FOR_BUILD)"; export CC; \
        CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+       CPP="$(CC_FOR_BUILD) -E "; export CPP; \
        CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
        CXX="$(CXX_FOR_BUILD)"; export CXX; \
        CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
diff -urN gcc-4.2.2-orig/Makefile.tpl gcc-4.2.2/Makefile.tpl
--- gcc-4.2.2-orig/Makefile.tpl 2007-11-23 14:22:42.000000000 +0100
+++ gcc-4.2.2/Makefile.tpl      2007-11-23 15:26:35.574341000 +0100
@@ -116,6 +116,7 @@
        AS="$(AS_FOR_BUILD)"; export AS; \
        CC="$(CC_FOR_BUILD)"; export CC; \
        CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+       CPP="$(CC_FOR_BUILD) -E "; export CPP; \
        CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
        CXX="$(CXX_FOR_BUILD)"; export CXX; \
        CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
diff -urN gcc-4.2.2-orig/gcc/configure gcc-4.2.2/gcc/configure
--- gcc-4.2.2-orig/gcc/configure        2007-11-23 14:22:47.000000000 +0100
+++ gcc-4.2.2/gcc/configure     2007-11-23 15:26:19.136630600 +0100
@@ -12716,6 +12716,7 @@
        esac
        saved_CFLAGS="${CFLAGS}"
        CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+       CPP="${CC_FOR_BUILD} -E " \
        CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \
                --enable-languages=${enable_languages-all} \
                --target=$target_alias --host=$build_alias --build=$build_alias
diff -urN gcc-4.2.2-orig/gcc/configure.ac gcc-4.2.2/gcc/configure.ac
--- gcc-4.2.2-orig/gcc/configure.ac     2007-11-23 14:22:30.000000000 +0100
+++ gcc-4.2.2/gcc/configure.ac  2007-11-23 15:26:28.355498600 +0100
@@ -1490,6 +1490,7 @@
        esac
        saved_CFLAGS="${CFLAGS}"
        CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+       CPP="${CC_FOR_BUILD} -E " \
        ${realsrcdir}/configure \
                --enable-languages=${enable_languages-all} \
                --target=$target_alias --host=$build_alias --build=$build_alias
Comment 1 Tom Tromey 2007-11-25 21:20:21 UTC
Not a preprocessor bug; refiling to 'other'.
Comment 2 Andrew Pinski 2021-08-24 06:55:23 UTC
It looks like it is working already in GCC 10:

configure:4018: checking how to run the C preprocessor
configure:4049: gcc -E  conftest.c
configure:4049: $? = 0

I don't see anywhere CPP gets set in the normal process.  So unless you define it, it will not be passed.

How did you configure GCC?  Normally you don't need to set CC or CXX or CPP.