Skip to content

Using compilers with -o absolute-path/to/target is broken for recent cctools #117

@rgommers

Description

@rgommers

With the latest build of cctools in conda-forge, using Clang or GFortran with an absolute path to the output target results in a broken binary.

Here is a simple reproducer for Fortran code. With a test file sanitycheckf.f90:

program main; print *, "Fortran compilation is working."; end program

And using the arm64-apple-darwin20.0.0-gfortran compiler, I see the following on an arm64 Macbook:

% rm sanitycheckf
% gfortran build/meson-private/sanitycheckf.f90 -o /Users/rgommers/code/scipy/sanitycheckf       
% ./sanitycheckf 
zsh: killed     ./sanitycheckf
% rm sanitycheckf
% gfortran build/meson-private/sanitycheckf.f90 -o sanitycheckf 
% ./sanitycheckf                                              
 Fortran compilation is working.

Showing that a simple absolute path is enough to trigger the problem.

On conda-forge/cctools-and-ld64-feedstock#50 (comment) @erykoff observed the same issue with a hello world C program and Clang.

Copying the produced binary (cp sanitycheckf sanitycheckf2 && cp sanitycheckf2 sanitycheckf) makes the problem go away. Downgrading to an older cctools version also made the problem go away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions