gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building Gforth for Apple's new Arm-based Macs


From: Craig Treleaven
Subject: Re: Building Gforth for Apple's new Arm-based Macs
Date: Wed, 20 Jan 2021 10:07:10 -0500

> On Jan 19, 2021, at 6:08 PM, Anton Ertl <anton@mips.complang.tuwien.ac.at> 
> wrote:
> 
> On Tue, Jan 19, 2021 at 02:42:10PM -0500, Craig Treleaven wrote:
>> Hi:
>> 
>> I contribute a little to the MacPorts project.  MacPorts packages many, many 
>> open source software titles for use on Macintosh.  I noticed that Gforth 
>> failed to build on our new buildbot running on an M1 machine(aka Apple’s 64 
>> bit ARM SOC).  The configure phase reported the following error:
>> 
>> checking build system type... Invalid configuration 
>> `arm64-apple-darwin20.1.0': machine `arm64-apple' not recognized
>> configure: error: /bin/sh ./config.sub arm64-apple-darwin20.1.0 failed
> 
> config.sub apparently does not know this architecture under the name
> arm64, but instead under the name aarch64.
> 
>> For a number of years, we’ve invoked configure thusly on Intel 64 bit-based 
>> Macs:
>> 
>> ./configure --prefix=/opt/local --build=x86_64-apple-darwin14.5.0 
>> 
>> I browsed through configure.ac but I have only a rudimentary knowledge of 
>> auto tools and couldn’t determine if the “-build” flag was even necessary;
> 
> If you are not cross-building, you don't need --build.  configure then
> looks at the current machine and guesses the machine from that (with
> config.guess).

Many thanks for explaining so clearly.

So I’ve tried several different combinations…sorry for the length of this email.

I’m running these on an older MacBook Pro (Core i7) which identifies thusly:

$ uname -m
x86_64
$ uname -rs
Darwin 14.5.0

Running config.guess gives:

$ ./config.guess
i386-apple-darwin14.5.0

If I omit the build flag, configure says (in part):

./configure --prefix=/opt/local
...
checking build system type... i386-apple-darwin14.5.0
checking host system type... i386-apple-darwin14.5.0
Check for arch/386//gforth.ld (false)

But it fails testing:

--- ./test/coretest.out 2013-10-11 17:31:28.000000000 -0400
***************
*** 1,10 ****
! redefined {  
! 
! Floating point exception: 8.
! INCORRECT RESULT: { -1 S>D 1 FM/MOD -> 0 -1 }
! INCORRECT RESULT: { -2 S>D 1 FM/MOD -> 0 -2 }
! INCORRECT RESULT: { 1 S>D -1 FM/MOD -> 0 -1 }
! INCORRECT RESULT: { 2 S>D -1 FM/MOD -> 0 -2 }
! INCORRECT RESULT: {  7 S>D -3 FM/MOD -> -2 -3 }
! INCORRECT RESULT: { -7 S>D  3 FM/MOD -> 2 -3 }
! INCORRECT RESULT: { -7 S>D -3 FM/MOD -> -1 2 }
--- 1,17 ----
! redefined {  redefined GDX  YOU SHOULD SEE THE STANDARD GRAPHIC CHARACTERS:
!  !"#$%&'()*+,-./0123456789:;<=>?@
! ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`
! abcdefghijklmnopqrstuvwxyz{|}~
! YOU SHOULD SEE 0-9 SEPARATED BY A SPACE:
! 0 1 2 3 4 5 6 7 8 9 
! YOU SHOULD SEE 0-9 (WITH NO SPACES):
! 0123456789
! YOU SHOULD SEE A-G SEPARATED BY A SPACE:
! A B C D E F G 
! YOU SHOULD SEE 0-5 SEPARATED BY TWO SPACES:
! 0  1  2  3  4  5  
! YOU SHOULD SEE TWO SEPARATE LINES:
! LINE 1
! LINE 2
! you should see this first. 
! you should see this later. 
make[3]: *** [checkone] Error 1


If I set the build flag to x86_64 on my machine, Gforth configures and builds 
OK and passes all tests.  Configure says:

./configure --prefix=/opt/local --build=x86_64 
...
checking build system type... x86_64-pc-none
checking host system type... x86_64-pc-none
Check for arch/amd64//gforth.ld (false)


Unless you have a better solution, it appears we need to keep adding the build 
flag to configure.  

Re the arm-based macs, configure does not seem to like aarch64:

./configure --prefix=/opt/local --build=aarch64 
…
checking build system type... Invalid configuration `aarch64': machine 
`aarch64' not recognized
configure: error: /bin/sh ./config.sub aarch64 failed
Command failed:  cd 
"/opt/local/var/macports/build/_Users_craigtreleaven_mp_macports-ports_lang_gforth/gforth/work/gforth-0.7.3"
 && ./configure --prefix=/opt/local --build=aarch64 
Exit code: 1

If I pass just “-build=arm”, configure at least completes without error.  I 
plan to try that on our arm-based buildbot…except the MacPorts buildbots are 
currently jammed up with a backlog of work from a big commit yesterday.  Sigh.

Thanks again.

Craig





reply via email to

[Prev in Thread] Current Thread [Next in Thread]