public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: -xlan- <ahsan.ahmed3246@gmail.com>
To: Iain Sandoe <idsandoe@googlemail.com>
Cc: GCC Development <gcc@gcc.gnu.org>,
	Jonathan Wakely <jwakely.gcc@gmail.com>
Subject: Re: Failure During Building
Date: Sat, 18 Feb 2023 12:28:15 -0800	[thread overview]
Message-ID: <CAOZ-8gVxoxPBO4FmAKDmHvw1M70r7QQpV_vqkOonnF1BWf6UKw@mail.gmail.com> (raw)
In-Reply-To: <3FB34CBA-3065-4596-994D-D666BFA7B632@googlemail.com>

[-- Attachment #1: Type: text/plain, Size: 3764 bytes --]

I tried compiling version 12.2.0 and it attempts to access system headers
at /usr/include, but on mac the system headers are stored at

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include.

Here's my error:
rm -rf include-fixed; mkdir include-fixed
chmod a+rx include-fixed
if [ -d ../prev-gcc ]; then \
	  cd ../prev-gcc && \
	  /Library/Developer/CommandLineTools/usr/bin/make
real-install-headers-tar DESTDIR=`pwd`/../gcc/ \
	    libsubdir=. ; \
	else \
	  set -e; for ml in `cat fixinc_list`; do \
	    sysroot_headers_suffix=`echo ${ml} | sed -e 's/;.*$//'`; \
	    multi_dir=`echo ${ml} | sed -e 's/^[^;]*;//'`; \
	    fix_dir=include-fixed${multi_dir}; \
	    if ! false && test ! -d `echo /usr/include | sed -e :a -e
's,[^/]*/\.\.\/,,' -e ta`; then \
	      echo The directory that should contain system headers does not
exist: >&2 ; \
	      echo "  `echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e
ta`" >&2 ; \
	      tooldir_sysinc=`echo
"/lib/gcc/x86_64-apple-darwin21.6.0/12.2.0/../../../../x86_64-apple-darwin21.6.0/sys-include"
| sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \
	      if test "x`echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,'
-e ta`" = "x${tooldir_sysinc}"; \
	      then sleep 1; else exit 1; fi; \
	    fi; \
	    /bin/sh ../../gcc-12.2.0/gcc/../mkinstalldirs ${fix_dir}; \
	    chmod a+rx ${fix_dir} || true; \
	    (TARGET_MACHINE='x86_64-apple-darwin21.6.0'; srcdir=`cd
../../gcc-12.2.0/gcc; ${PWDCMD-pwd}`; \
	      SHELL='/bin/sh'; MACRO_LIST=`${PWDCMD-pwd}`/macro_list ; \
	      gcc_dir=`${PWDCMD-pwd}` ; \
	      export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
	      cd ../build-x86_64-apple-darwin21.6.0/fixincludes && \
	      /bin/sh ./fixinc.sh "${gcc_dir}/${fix_dir}" \
	        `echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`  ); \
	    rm -f ${fix_dir}/syslimits.h; \
	    if [ -f ${fix_dir}/limits.h ]; then \
	      mv ${fix_dir}/limits.h ${fix_dir}/syslimits.h; \
	    else \
	      cp ../../gcc-12.2.0/gcc/gsyslimits.h ${fix_dir}/syslimits.h; \
	    fi; \
	    chmod a+r ${fix_dir}/syslimits.h; \
	  done; \
	fi
The directory that should contain system headers does not exist:
  /usr/include
make[1]: *** [stmp-fixinc] Error 1
make: *** [all-gcc] Error 2


On Fri, Feb 17, 2023 at 8:04 AM Iain Sandoe <idsandoe@googlemail.com> wrote:

>
>
> > On 17 Feb 2023, at 15:37, Jonathan Wakely via Gcc <gcc@gcc.gnu.org>
> wrote:
> >
> > On Fri, 17 Feb 2023, 15:17 -xlan- via Gcc, <gcc@gcc.gnu.org> wrote:
> >
> >> I was building gcc version 4.9.1
> >
> >
> > Why?
>
> Indeed, what is the use-case?
> trying to build such an old GCC version on modern macOS could be
> problematic.
>
> > on Mac OS version when I got this error:
> >>
> >> In file included from ../../gcc-4.9.1/gcc/c/c-objc-common.c:33:
> >> In file included from
> >>
> >>
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
> >>
> >>
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:184:5:
> >> error: no member named 'fancy_abort' in namespace 'std::__1'; did you
> mean
> >> simply 'fancy_abort'?
> >>    _VSTD::abort();
> >>    ^~~~~~~
> >>
> >
> >
> > The GCC sources define 'abort' as a macro, which appears to be
> incompatible
> > with LLVM's libc++.
> >
> > You might be able to compile using -stdlib=libstdc++ instead.
>
> There are no headers for libstdc++ in SDKs for OSX 10.13 + (so you would
> need also to find an
> older SDK and then build with an OSX target of say 10.12).
>
> What you are trying to do is going to required quite advanced techniques
> to deal with the difference in the OS, compiler and bootstrap tools.  I
> have not attempted anything < GCC-5 on newer machines.
>
> Iain
>
>
>
>

  reply	other threads:[~2023-02-18 20:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 15:17 -xlan-
2023-02-17 15:37 ` Jonathan Wakely
2023-02-17 16:03   ` Iain Sandoe
2023-02-18 20:28     ` -xlan- [this message]
2023-02-18 23:49       ` Iain Sandoe
2023-02-19 16:27         ` -xlan-
2023-02-19 16:48           ` Iain Sandoe
2023-02-19 16:56             ` -xlan-

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=CAOZ-8gVxoxPBO4FmAKDmHvw1M70r7QQpV_vqkOonnF1BWf6UKw@mail.gmail.com \
    --to=ahsan.ahmed3246@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=idsandoe@googlemail.com \
    --cc=jwakely.gcc@gmail.com \
    /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).