Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copper: broken on darwin #123030

Merged
merged 1 commit into from May 14, 2021
Merged

copper: broken on darwin #123030

merged 1 commit into from May 14, 2021

Conversation

stephank
Copy link
Contributor

Motivation for this change

ZHF: #122042
cc @NixOS/nixos-release-managers

Hydra failure: https://hydra.nixos.org/build/142620896/nixlog/1

When setting CC to clang:

building
file-unix.c
Bootstrapping...
boot/copper-c-unix-64.c:1906:18: error: second parameter of 'main' (argument array) must be of type 'char **'
extern int CDECL main(int zargc, unsigned char **zargv);
                 ^
boot/copper-c-unix-64.c:3332:23: warning: declaration of built-in function 'fopen' requires inclusion of the header <stdio.h> [-Wbuiltin-requires-header]
extern FILE176 *CDECL fopen(unsigned char *, unsigned char *);
                      ^
boot/copper-c-unix-64.c:3334:21: warning: declaration of built-in function 'fread' requires inclusion of the header <stdio.h> [-Wbuiltin-requires-header]
extern size_t CDECL fread(unsigned char *, size_t , size_t , FILE176 *);
                    ^
boot/copper-c-unix-64.c:3335:21: warning: declaration of built-in function 'fwrite' requires inclusion of the header <stdio.h> [-Wbuiltin-requires-header]
extern size_t CDECL fwrite(unsigned char *, size_t , size_t , FILE176 *);
                    ^
boot/copper-c-unix-64.c:3837:11: error: second parameter of 'main' (argument array) must be of type 'char **'
int CDECL main(int zargc, unsigned char **zargv)
          ^
3 warnings and 2 errors generated.
make: *** [Makefile:131: boot] Error 1

When adding gcc as build input:

Linking...
ld: warning: ignoring file stage2/copper-elf64.o, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 )
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:147: stage2/copper-elf64] Error 1

(Not sure if clang works on other platforms.)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 0 10.rebuild-linux: 0 labels May 14, 2021
@rmcgibbo
Copy link
Contributor

cc also: #122842 (comment)

@veprbl
Copy link
Member

veprbl commented May 14, 2021

Technically, it's not broken, but plain unsupported, but describing that would be too much effort.

@veprbl veprbl merged commit f91dcdd into NixOS:master May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants