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

stdenv/linux/default.nix: add gcc rebuild during bootstrap #209063

Closed
wants to merge 1 commit into from

Commits on Jan 15, 2023

  1. stdenv/linux/default.nix: add gcc rebuild during bootstrap

    Before the change our rebuild chain was the followin:
    
    - `bootstrapTools` install
    - `binutils` built by `bootstrapTools`
    - `glibc` built by `bootstrapTools`
    - `gcc` built by `bootstrapTools`
    
    As a result `glibc` contained code generated by `bootstrapTools`'s
    `gcc`. And (what worse) copied `libgcc_s.so.1` as is from
    `bootstrapTools`'s `gcc`.
    
    Such `libgcc_s.so.1` was not compatible with `nixpkgs` `gcc` at
    least on `aarch64` where newer `libgcc` is expected to have new symbols.
    As a result linking failed as:
    
        ld: /build/test.o: in function `foo(int)':
        test.cpp:(.text+0x2c): undefined reference to `__aarch64_ldadd4_acq_rel'
        collect2: error: ld returned 1 exit status
    
    The change rejigs rebuild sequence as:
    
    - `bootstrapTools` install
    - `binutils` built by `bootstrapTools`
    - `gcc` built by `bootstrapTools`
    - `glibc` built by `gcc`
    - `gcc` built by `gcc`
    
    As a result `glibc` gets built by fresher `gcc` and embeds a copy
    of `libgcc_s.so.1`.
    
    Co-authored-by: Rick van Schijndel <Mindavi@users.noreply.github.com>
    trofi and Mindavi committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    03da08b View commit details
    Browse the repository at this point in the history