Skip to content

Compilation fails for MacOS/ARM64 #547

@awvwgk

Description

@awvwgk

This linking error occurs when cross-compiling a MacOS/ARM64 version of fpm from MacOS/x86_64.

 + $BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-gfortran  -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib -march=armv8.3-a -ftree-vectorize -fPIC -fno-stack-protector -O2 -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/fpm-0.4.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -J build/arm64-apple-darwin20.0.0-gfortran_4605AD8986954164/fpm -I build/arm64-apple-darwin20.0.0-gfortran_4605AD8986954164/fpm  build/arm64-apple-darwin20.0.0-gfortran_4605AD8986954164/fpm/app_main.f90.o build/arm64-apple-darwin20.0.0-gfortran_4605AD8986954164/fpm/libfpm.a -o build/arm64-apple-darwin20.0.0-gfortran_4605AD8986954164/app/fpm
Undefined symbols for architecture arm64:
  "_opendir$INODE64", referenced from:
      _c_opendir in libfpm.a(src_filesystem_utilities.c.o)
  "_readdir$INODE64", referenced from:
      _c_readdir in libfpm.a(src_filesystem_utilities.c.o)
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
STOP 1
 <ERROR> Compilation failed for object "fpm"

It is save to assume that the current git source won't compile on native MacOS/ARM64 at the moment as well.

The additional suffix required for opendir is probably not required on MacOS/ARM64, which means we have to add another preprocessor branch for this. First, we have to identify which macro is set on MacOS/ARM64 and can be used to identify the architecture (see https://sourceforge.net/p/predef/wiki/Architectures/ for a list of architecture macros).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions