public inbox for newlib-cvs@sourceware.org help / color / mirror / Atom feed
From: Michael Frysinger <vapier@sourceware.org> To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] libgloss: build with -nostdinc Date: Thu, 17 Feb 2022 01:30:30 +0000 (GMT) [thread overview] Message-ID: <20220217013030.4076E3858D20@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e0c0ad8268af60a2413edcab84320eef1e6ce5f9 commit e0c0ad8268af60a2413edcab84320eef1e6ce5f9 Author: Mike Frysinger <vapier@gentoo.org> Date: Sat Feb 12 01:59:13 2022 -0500 libgloss: build with -nostdinc We don't want libgloss building against C library headers that happened to be installed with the toolchain, so add -nostdinc to the build. We still need access to the compiler internal headers, so probe those and include them via -isystem. This uses a similar probing style as glibc, which has used it for over a decade, so it should be safe & stable. This should prevent any latent bugs due to testing with a toolchain that is fully configured & installed already. Diff: --- libgloss/configure | 20 ++++++++++++++++++++ libgloss/configure.ac | 11 +++++++++++ 2 files changed, 31 insertions(+) diff --git a/libgloss/configure b/libgloss/configure index abe3a574c..215a5c7a5 100755 --- a/libgloss/configure +++ b/libgloss/configure @@ -5104,6 +5104,26 @@ esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler search settings" >&5 +$as_echo_n "checking for compiler search settings... " >&6; } +if ${libc_cv_compiler_isystem+:} false; then : + $as_echo_n "(cached) " >&6 +else + for subdir in include include-fixed; do + if dir=`$CC -print-file-name=$subdir`; then : + if test -n "$dir"; then : + libc_cv_compiler_isystem="$libc_cv_compiler_isystem -isystem $dir" + +fi + +fi + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_isystem" >&5 +$as_echo "$libc_cv_compiler_isystem" >&6; } +CC="$CC -nostdinc $libc_cv_compiler_isystem" + host_makefile_frag_path=$host_makefile_frag diff --git a/libgloss/configure.ac b/libgloss/configure.ac index 78e92a0e8..06d17d8b5 100644 --- a/libgloss/configure.ac +++ b/libgloss/configure.ac @@ -336,6 +336,17 @@ m4_include([mcore/acinclude.m4]) m4_include([mn10300/acinclude.m4]) m4_include([moxie/acinclude.m4]) +AC_CACHE_CHECK([for compiler search settings], libc_cv_compiler_isystem, [dnl + for subdir in include include-fixed; do + AS_IF([dir=`$CC -print-file-name=$subdir`], [dnl + AS_IF([test -n "$dir"], [dnl + libc_cv_compiler_isystem="$libc_cv_compiler_isystem -isystem $dir" + ]) + ]) + done +]) +CC="$CC -nostdinc $libc_cv_compiler_isystem" + dnl We have to assign the same value to other variables because autoconf dnl doesn't provide a mechanism to substitute a replacement keyword with dnl arbitrary data or pathnames.
reply other threads:[~2022-02-17 1:30 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220217013030.4076E3858D20@sourceware.org \ --to=vapier@sourceware.org \ --cc=newlib-cvs@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: linkBe 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).