public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Failure During Building
@ 2023-02-17 15:17 -xlan-
  2023-02-17 15:37 ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: -xlan- @ 2023-02-17 15:17 UTC (permalink / raw)
  To: gcc

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

I was building gcc version 4.9.1 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();
    ^~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:858:15:
note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_ABI_NAMESPACE
              ^
../../gcc-4.9.1/gcc/system.h:685:13: note: 'fancy_abort' declared here
extern void fancy_abort (const char *, int, const char *)
ATTRIBUTE_NORETURN;
            ^
1 error generated.
make[1]: *** [c/c-objc-common.o] Error 1
make: *** [all-gcc] Error 2

Mac OS: Monterey 12.6.4

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

* Re: Failure During Building
  2023-02-17 15:17 Failure During Building -xlan-
@ 2023-02-17 15:37 ` Jonathan Wakely
  2023-02-17 16:03   ` Iain Sandoe
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2023-02-17 15:37 UTC (permalink / raw)
  To: -xlan-; +Cc: gcc

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

On Fri, 17 Feb 2023, 15:17 -xlan- via Gcc, <gcc@gcc.gnu.org> wrote:

> I was building gcc version 4.9.1


Why?


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.

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:858:15:
> note: expanded from macro '_VSTD'
> #define _VSTD std::_LIBCPP_ABI_NAMESPACE
>               ^
> ../../gcc-4.9.1/gcc/system.h:685:13: note: 'fancy_abort' declared here
> extern void fancy_abort (const char *, int, const char *)
> ATTRIBUTE_NORETURN;
>             ^
> 1 error generated.
> make[1]: *** [c/c-objc-common.o] Error 1
> make: *** [all-gcc] Error 2
>
> Mac OS: Monterey 12.6.4
>

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

* Re: Failure During Building
  2023-02-17 15:37 ` Jonathan Wakely
@ 2023-02-17 16:03   ` Iain Sandoe
  2023-02-18 20:28     ` -xlan-
  0 siblings, 1 reply; 8+ messages in thread
From: Iain Sandoe @ 2023-02-17 16:03 UTC (permalink / raw)
  To: -xlan-; +Cc: GCC Development, Jonathan Wakely



> 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




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

* Re: Failure During Building
  2023-02-17 16:03   ` Iain Sandoe
@ 2023-02-18 20:28     ` -xlan-
  2023-02-18 23:49       ` Iain Sandoe
  0 siblings, 1 reply; 8+ messages in thread
From: -xlan- @ 2023-02-18 20:28 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: GCC Development, Jonathan Wakely

[-- 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
>
>
>
>

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

* Re: Failure During Building
  2023-02-18 20:28     ` -xlan-
@ 2023-02-18 23:49       ` Iain Sandoe
  2023-02-19 16:27         ` -xlan-
  0 siblings, 1 reply; 8+ messages in thread
From: Iain Sandoe @ 2023-02-18 23:49 UTC (permalink / raw)
  To: -xlan-; +Cc: GCC Development

Hi

> On 18 Feb 2023, at 20:28, -xlan- <ahsan.ahmed3246@gmail.com> wrote:
> 
> 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.

For supported x86_64 GCC versions (at present 12 and trunk) on macOS12.

It is usually easiest to install the Xcode Command Line Tools - the SDK path is then /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk

then add the following to your configure line:

—with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk

If you want to use the set in Xcode then add the following to your configure line:

—with-sysroot=`xcrun --show-sdk-path`

I prefer/recommend the first option.
HTH,
Iain



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

* Re: Failure During Building
  2023-02-18 23:49       ` Iain Sandoe
@ 2023-02-19 16:27         ` -xlan-
  2023-02-19 16:48           ` Iain Sandoe
  0 siblings, 1 reply; 8+ messages in thread
From: -xlan- @ 2023-02-19 16:27 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: GCC Development

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

Hi, I have the SDK installed but I don't understand how to use the
--with-sysroot command. Is the flag supposed to be with my make all-gcc
command, please elaborate.
On Sat, Feb 18, 2023 at 3:49 PM Iain Sandoe <idsandoe@googlemail.com> wrote:

> Hi
>
> > On 18 Feb 2023, at 20:28, -xlan- <ahsan.ahmed3246@gmail.com> wrote:
> >
> > 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.
>
> For supported x86_64 GCC versions (at present 12 and trunk) on macOS12.
>
> It is usually easiest to install the Xcode Command Line Tools - the SDK
> path is then /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
>
> then add the following to your configure line:
>
> —with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
>
> If you want to use the set in Xcode then add the following to your
> configure line:
>
> —with-sysroot=`xcrun --show-sdk-path`
>
> I prefer/recommend the first option.
> HTH,
> Iain
>
>
>

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

* Re: Failure During Building
  2023-02-19 16:27         ` -xlan-
@ 2023-02-19 16:48           ` Iain Sandoe
  2023-02-19 16:56             ` -xlan-
  0 siblings, 1 reply; 8+ messages in thread
From: Iain Sandoe @ 2023-02-19 16:48 UTC (permalink / raw)
  To: -xlan-; +Cc: GCC Development



> On 19 Feb 2023, at 16:27, -xlan- <ahsan.ahmed3246@gmail.com> wrote:
> 
> Hi, I have the SDK installed but I don't understand how to use the --with-sysroot command. Is the flag supposed to be with my make all-gcc command, please elaborate.

It is a configure argument for GCC’s configure script - there is more information here:
https://gcc.gnu.org/install/  (and in the linked pages)

 I guess (in your build script) you have something like 

…/configure —prefix=…. 

the --with-sysroot=…. need to be appended to that.

Iain


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

* Re: Failure During Building
  2023-02-19 16:48           ` Iain Sandoe
@ 2023-02-19 16:56             ` -xlan-
  0 siblings, 0 replies; 8+ messages in thread
From: -xlan- @ 2023-02-19 16:56 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: GCC Development

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

Thanks, I'll check it out.

On Sun, Feb 19, 2023 at 8:48 AM Iain Sandoe <idsandoe@googlemail.com> wrote:

>
>
> > On 19 Feb 2023, at 16:27, -xlan- <ahsan.ahmed3246@gmail.com> wrote:
> >
> > Hi, I have the SDK installed but I don't understand how to use the
> --with-sysroot command. Is the flag supposed to be with my make all-gcc
> command, please elaborate.
>
> It is a configure argument for GCC’s configure script - there is more
> information here:
> https://gcc.gnu.org/install/  (and in the linked pages)
>
>  I guess (in your build script) you have something like
>
> …/configure —prefix=….
>
> the --with-sysroot=…. need to be appended to that.
>
> Iain
>
>

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

end of thread, other threads:[~2023-02-20 13:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-17 15:17 Failure During Building -xlan-
2023-02-17 15:37 ` Jonathan Wakely
2023-02-17 16:03   ` Iain Sandoe
2023-02-18 20:28     ` -xlan-
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-

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).