nixpkgs-mozilla icon indicating copy to clipboard operation
nixpkgs-mozilla copied to clipboard

Firefox fails to compile because -fPIC is passed to `as`

Open kvark opened this issue 4 years ago • 1 comments

[nix-shell:/x/code/firefox]$ ./mach build
 0:00.62 Failed to parse ccache stats output: Summary:
 0:00.63 Clobber not needed.
 0:00.65 Adding make options from /x/code/firefox/.mozconfig.nix-shell
    AUTOCONF=/nix/store/k849r077ywbj8mqby4yn8y177466cb4q-autoconf-2.13/bin/autoconf
    MOZ_OBJDIR=/x/code/firefox/obj-x86_64-pc-linux-gnu
    OBJDIR=/x/code/firefox/obj-x86_64-pc-linux-gnu
    FOUND_MOZCONFIG=/x/code/firefox/.mozconfig.nix-shell
    export FOUND_MOZCONFIG
  Parallelism determined by memory: using 8 jobs for 8 cores based on 62.6 GiB RAM and estimated job size of 2.0 GiB
 0:00.65 /nix/store/4xzvmpwx8lhjgiypdkffl4nzg6pb4lcb-gnumake-4.3/bin/make -f client.mk -j8 -s
 0:00.81 Elapsed: 0.00s; From dist/private: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:00.85 Elapsed: 0.00s; From dist/public: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:00.86 Elapsed: 0.01s; From dist/xpi-stage: Kept 94 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:00.97 Elapsed: 0.11s; From _tests: Kept 1241 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:00.99 Elapsed: 0.15s; From dist/bin: Kept 2654 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:01.08 Elapsed: 0.22s; From dist/include: Kept 6444 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:01.11 ./buildid.h.stub
 0:01.11 ./source-repo.h.stub
 0:01.23 ./application.ini.stub
 0:01.23 ./IsCombiningDiacritic.h.stub
 0:01.39 ./application.ini.h.stub
 0:01.98 config/external/nspr/pr
 0:01.99 /nix/store/4g5fidyk19akng9n91cql60ylrjq93s6-gcc-wrapper-10.3.0/bin/as: invalid option -- 'P'
 0:01.99 make[4]: *** [/x/code/firefox/config/rules.mk:608: os_Linux_x86_64.o] Error 1
 0:02.00 make[3]: *** [/x/code/firefox/config/recurse.mk:72: config/external/nspr/pr/target-objects] Error 2
 0:02.00 make[3]: *** Waiting for unfinished jobs....
 0:02.01 make[2]: *** [/x/code/firefox/config/recurse.mk:34: compile] Error 2
 0:02.01 make[1]: *** [/x/code/firefox/config/rules.mk:352: default] Error 2
 0:02.01 make: *** [client.mk:63: build] Error 2
 0:02.01 0 compiler warnings present.
 0:02.04 Failed to parse ccache stats output: Summary:

Doesn't happen all the time, but is a blocker when it does :(

kvark avatar Nov 24 '21 15:11 kvark

Figured out this only happens when I'm building with this shell on top of the overlay:

with import <nixpkgs> {};
mkShell {
  buildInputs = [
    # rust
    gdb
    cargo
    rustc
    rustfmt
    #rustup
    clippy
    wasm-pack
    # xserver
    xorg.libX11
    xorg.libXi
    xorg.libXcursor
    xorg.libXrandr
    xorg.libXext
    xorg.libxshmfence
    xorg.libXxf86vm
    libxkbcommon
    wayland
    wayland-protocols
    # libraries
    libdrm
    libelf
    libGL
    alsaLib
    llvmPackages_11.llvm
    # tools
    cmake
    cmakeCurses
    meson
    ninja
    pkgconfig
    python
    (python3.withPackages(ps: [
      ps.setuptools
      ps.Mako
    ]))
    bison
    flex
    zip
    git-cinnabar
    # vulkan
    glslang
    vulkan-headers
    vulkan-loader
    vulkan-validation-layers
    vulkan-tools
    # apps
    mangohud
  ];
  
  LIB_PATH = lib.makeLibraryPath [
    vulkan-loader
    libGL
    xorg.libX11
    xorg.libXi
    xorg.libXcursor
    xorg.libXrandr
    wayland
    libxkbcommon
  ];
  shellHook = ''
    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_PATH";
  '';
}

So it's still unclear to me why this configuration spooks Gecko builds, but at least it's not a blocker any more.

kvark avatar Nov 24 '21 15:11 kvark