Re: [GSoC] Help needed for building on aarch64-apple-darwin22.1.0

2023-02-21 Thread Stuff Received

Greetings, Iaian.

On 2023-02-20 12:42, Iain Sandoe wrote:

Hi Shengyu,


On 20 Feb 2023, at 17:31, Shengyu Huang via Gcc  wrote:




After following the instructions here (https://gcc.gnu.org/wiki/InstallingGCC) 
and here (https://gcc.gnu.org/install/index.html), the `make` step simply fails 
with “*** Configuration aarch64-apple-darwin22.1.0 not supported”. I found this 
issue on Bugzilla (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96168), but the 
status says it’s suspended. Does it mean there is no way I can build from 
source on my new laptop? My old MBP was unfortunately broken two months ago, so 
the new laptop with Apple M2 is the only device I have at the moment.


I have a development branch for trunk here :
   https://github.com/iains/gcc-darwin-arm64


This is wonderful -- thank you for doing this!

I am not interested in gfortran but rather gm2 and your branch for the 
trunk works quite well.


Sincerely,
john



and for GCC-12 here:
  https://github.com/iains/gcc-12-branch

until I have some time to upstream the work (which could not be before GCC-14, 
I think) you can use these.

HTH,
Iain





Re: Building gcc-12 on MacOS Ventura (aarch64)

2023-03-24 Thread Stuff Received

On 2023-03-24 19:51, Chris Johns wrote:

On 25/3/2023 10:07 am, Jonathan Wakely wrote:

On Fri, 24 Mar 2023, 23:07 Jonathan Wakely, mailto:jwakely@gmail.com>> wrote:
 On Fri, 24 Mar 2023, 23:03 Chris Johns, mailto:ch...@contemporary.net.au>> wrote:

 Hi,

 I am sorting out some issues building RTEMS on MacOS including the M
 processors.
 The building gcc-12.2.1 for the few architectures I tested fail with 
sig
 faults
 in xgcc when building the runtime. I tried arm, aarch64 and sparc. As a
 result I
 wondered about bootstrapping gcc and using that to build the tools
 rather than
 clang from Xcode.

 Is aarch64-apple-darwin supported?

 No. Iain Sandoe has some personal branches with changes to support it, but
 the changes are not in the official gcc repo yet. If you search the
 gcc-h...@gcc.gnu.org  list you'll find links 
to
 his code. I think Homebrew is his patches too.

*uses his patches too.



I tried Iain's repo and it fails in the same way.

I have been building the tools on MacOS for over a decade with just the Apple
base to make sure we have a clean platform without any issues. To do that I
avoid MacPorts and Homebrew. I am fine with our users making use of those
packages however knowing a build works with just the Apple support makes our
support simpler.

Chris


I am able to build gcc from Iain's repo gcc-darwin-arm64 on an M1 Mini, 
running macos 11.3.1, using the following configuration.  (Change your 
language preferences accordingly.)  I used make -j4.


CC=/opt/homebrew/bin/gcc-12 \
CXX=/opt/homebrew/bin/g++-12 \
../../src/gcc-darwin-arm64/configure \
--prefix=$HOME/gm2/arm64 \
--exec-prefix=$HOME/gm2/arm64 \
--enable-languages=c,c++,m2 \
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk \
--with-mpc=/opt/homebrew \
--with-gmp=/opt/homebrew \
--with-mpfr=/opt/homebrew \
--disable-bootstrap \
--enable-threads=posix

However, you must first define HAVE_FCNTL_H to 1 in libiberty/config.h 
(that is missed somehow by configure).


Sincerely,
N.