pkgsrc-Users archive

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

gcc and libtool-fortran



hi-

    i'm trying to build a package that uses libtool-fortran on
a recent M4 macbook running 15.3.1.   building libtool-fortran
triggers a lang/gcc12 build to generate a fortran compiler.

    unfortunately, compiling gcc12 on this aarch64 system fails
with the following error:

/usr/local/src/pkgsrc/lang/gcc12/work/build/./gcc/xgcc -B/usr/local/src/pkgsrc/lang/gcc12/work/build/./gcc/ -B/usr/local/pkg.2502/gcc12/aarch64-apple-darwin24/bin/ -B/usr/local/pkg.2502/gcc12/aarch64-apple-darwin24/lib/ -isystem /usr/local/pkg.2502/gcc12/aarch64-apple-darwin24/include -isystem /usr/local/pkg.2502/gcc12/aarch64-apple-darwin24/sys-include    -g -O2 -O2  -g -O2 -DIN_GCC   -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -mmacosx-version-min=11 -mmacosx-version-min=11.0 -fno-common -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -mmacosx-version-min=11 -mmacosx-version-min=11.0 -fno-common -I. -I. -I../.././gcc -I../../../gcc-12.4.0/libgcc -I../../../gcc-12.4.0/libgcc/. -I../../../gcc-12.4.0/libgcc/../gcc -I../../../gcc-12.4.0/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS  -o cas_1_1.o -MT cas_1_1.o -MD -MP -MF cas_1_1.dep -DL_cas -DSIZE=1 -DMODEL=1 -c ../../../gcc-12.4.0/libgcc/config/aarch64/lse.S
<instantiation>:5:1: error: non-private labels cannot appear between .cfi_startproc / .cfi_endproc pairs
___aarch64_cas1_relax:
^
../../../gcc-12.4.0/libgcc/config/aarch64/lse.S:220:1: note: while in macro instantiation
STARTFN __aarch64_cas1_relax
^
<instantiation>:4:2: error: previous .cfi_startproc was here
 .cfi_startproc
 ^
../../../gcc-12.4.0/libgcc/config/aarch64/lse.S:220:1: note: while in macro instantiation
STARTFN __aarch64_cas1_relax
^
gmake[2]: *** [../../../gcc-12.4.0/libgcc/config/aarch64/t-lse:44: cas_1_1.o] Error 1


gcc12 is old, so I tried manually building lang/gcc13.   it fails
with bad pkgsrc patches:


===> Patching for gcc13-13.3.0nb1
=> Applying distribution patches for gcc13-13.3.0nb1
=> Applying pkgsrc patches for gcc13-13.3.0nb1
1 out of 3 hunks failed--saving rejects to libgcc/config.host.rej
Patch /usr/local/src/pkgsrc/lang/gcc13/../../lang/gcc13/patches/patch-libgcc_config.host failed
ERROR: Patching failed due to modified or broken patch file(s):
ERROR:  /usr/local/src/pkgsrc/lang/gcc13/../../lang/gcc13/patches/patch-libgcc_config.host
ERROR: ==========================================================================
ERROR:
ERROR: Some of the selected build options and/or local patches may be incompatible.
ERROR: Please try building with fewer options or patches.
ERROR:
ERROR: ==========================================================================
*** Error code 1

Stop.



but building lang/gcc14 works (at least the fortran compiler it
generates can build a simple fortran 'hello world').


I had thought that building and installing lang/gcc14 would cause
the libtool-fortran build to pick up the newer gcc14, but it is
still trying to build gcc12 instead.

I think the connection to gcc12 in is mk/compiler/gfortran.mk
where it has:

# Choose gcc12 for Darwin/aarch64.  \todo Explain why.
# gcc7 does not build on Darwin 12.6.x, so match aarch64.
.if ${MACHINE_PLATFORM:MDarwin-*-*}
POSSIBLE_GFORTRAN_VERSION=      12
.endif

and later it does:

# If the POSSIBLE version exists in pkgsrc, use it.
# Otherwise, pick gcc 10 as a mainstream default.
.if exists(${PKGSRCDIR}/lang/gcc${POSSIBLE_GFORTRAN_VERSION}/buildlink3.mk)
GFORTRAN_VERSION?=              ${POSSIBLE_GFORTRAN_VERSION}
.else
GFORTRAN_VERSION?=              10
.endif


which isn't really the semantics you want?   I was hoping it
would see that i've installed lang/gcc14 which is newer than
the lang/gcc12 set by POSSIBLE_GFORTRAN_VERSION and try to use 
the newer gcc14.


setting GFORTRAN_VERSION=14 in etc/mk.conf does get libtool-fortran
to build using gcc14, but it seems like a fairly tricky thing
to figure out?


chuck


Home | Main Index | Thread Index | Old Index