Opened 3 years ago

Closed 9 months ago

#62451 closed defect (fixed)

calc: is not using the right compiler; is using -march=native

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: pmetzger (Perry E. Metzger)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc:
Port: calc

Description

From this log:

https://build.macports.org/builders/ports-11_arm64-builder/builds/10875/steps/install-port/logs/stdio

clang -DCALC_SRC -DCUSTOM -Wall -arch arm64 -march=native   -fPIC longbits.c -c
clang: error: the clang compiler does not support '-march=native'

we see that calc isn't UsingTheRightCompiler and we see that it is using -march=native which it should not do unless in a +native variant.

Change History (10)

comment:1 Changed 3 years ago by pmetzger (Perry E. Metzger)

I don't have access to an Apple Silicon machine; do you think you can tell me what the thing needs to be able to do in order to compile correctly?

comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Well for a start probably not use -march=native since I think that is an Intel-specific option. But we also don't want to use it on Intel machines, unless the user requested it with a +native variant.

comment:3 Changed 3 years ago by pmetzger (Perry E. Metzger)

So you would prefer that I remove -march=native entirely? That's pretty easy to do I suspect as I could just patch it out of the Makefile. (Unfortunately calc uses a really weird build system and trying to do this the subtle way may not be easy.) If you confirm that, I'll make that change to the port.

comment:4 Changed 3 years ago by pmetzger (Perry E. Metzger)

Just a quick ping; should I remove -march=native entirely?

comment:5 Changed 3 years ago by dwmalone

Hi Perry - I've just tripped over this too, when trying to compile calc in 2.7.1. I compiled it from sources by hand, dropping the -march=native flag, and it seems to work fine. I think dropping -march=native seems sensible here.

Last edited 3 years ago by dwmalone (previous) (diff)

comment:6 Changed 3 years ago by pmetzger (Perry E. Metzger)

I believe that I just pushed a fix for the -march=native part of the problem, though I'm not 100% sure how to fix the compiler choice as calc doesn't use autoconf but rather a complicated home-grown alternative.

Could you check that the build on Apple Silicon seems to be working correctly now?

comment:7 Changed 3 years ago by dwmalone

Yes - I've just tested and it seems to build fine for me now. Many thanks!

comment:8 Changed 9 months ago by barracuda156

Broken on PowerPC though:

--->  Extracting calc-2.14.2.1.tar.bz2
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_calc/calc/work" && /opt/local/bin/lbzip2 -dc '/opt/local/var/macports/distfiles/calc/calc-2.14.2.1.tar.bz2' | /usr/bin/gnutar --no-same-owner -xf - 
/usr/bin/gnutar: calc-2.14.2.1/cal/regress.cal: implausibly old time stamp 1970-01-01 08:00:00
--->  Applying patches to calc
--->  Applying patch-Makefile.local.diff
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_calc/calc/work/calc-2.14.2.1" && /usr/bin/patch -p0 < '/opt/PPCSnowLeopardPorts/math/calc/files/patch-Makefile.local.diff'
patching file Makefile.local
Hunk #1 succeeded at 38 (offset 1 line).
--->  Patching Makefile.local: s|___PREFIX___|/opt/local|
--->  Configuring calc
--->  Building calc
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_calc/calc/work/calc-2.14.2.1" && /usr/bin/make -j1 -w all CC=/usr/bin/gcc-4.2 DARWIN_ARCH="-arch ppc" 
make: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_calc/calc/work/calc-2.14.2.1'
forming have_limits.h
have_limits.h formed
forming have_ban_pragma.h
have_ban_pragma.h formed
forming charbit.h
make: [charbit.h] Error 127 (ignored)
charbit.h formed
forming have_unistd.h
have_unistd.h formed
forming have_stdlib.h
have_stdlib.h formed
forming longbits.h
make: *** [longbits.h] Error 127
make: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_calc/calc/work/calc-2.14.2.1'
Command failed:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_calc/calc/work/calc-2.14.2.1" && /usr/bin/make -j1 -w all CC=/usr/bin/gcc-4.2 DARWIN_ARCH="-arch ppc" 
Exit code: 2

comment:9 Changed 9 months ago by pmetzger (Perry E. Metzger)

So, it has now been, what, 17 years since the last PowerPC based Mac was sold? I am totally cool with accepting small, reasonable patches that will make PowerPC machines work and aren't onerous to maintain. I am not going to bother fixing this on my own.

comment:10 Changed 9 months ago by pmetzger (Perry E. Metzger)

Resolution: fixed
Status: assignedclosed

I think the -march=native problem has been fixed for quite some time FWIW so I'm closing this.

Note: See TracTickets for help on using tickets.