Skip to content

-iframework wrongly passed to certain targets of GCC on Darwin host #257258

Description

@Ivan-Velickovic

Describe the bug

When building certain ARM GCC cross-compilers on an x86 Darwin host, the -iframework flag is passed erroneously. The two cross-compilers that I have reproduced the issue for is aarch64-none-elf and aarch64-unknown-linux-gnu. Neither of these is targeting Darwin/macOS and hence the -iframework flag is expected to be unrecognisable to GCC.

I do not have access to an ARM64 Darwin machine, so do not know if the issue is reproducible there.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Enter a Nix shell using the cross-compiler with nix-shell -p pkgsCross.aarch64-embedded.buildPackages.gcc or nix-shell -p pkgsCross.aarch64-multiplatform.buildPackages.gcc
  2. Run any command invoking the compiler, such as aarch64-none-elf-gcc --version
  3. Observe the following behaviour: aarch64-none-elf-gcc: error: unrecognized command-line option ‘-iframework’

Expected behavior

No error message about -iframework.

Notify maintainers

@vcunat @Ericson2314

Metadata

 - system: `"x86_64-darwin"`
 - host os: `Darwin 21.6.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.16.1`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: cross-compilationBuilding packages on a different platform than they will be used on6.topic: darwinRunning or building packages on Darwin

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions