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

Some builds fail with invalid gcc flag "-Xarch_x86_64" (Linux+CMake+PCH) #94905

Closed
romildo opened this issue Aug 8, 2020 · 10 comments
Closed

Comments

@romildo
Copy link
Contributor

romildo commented Aug 8, 2020

Describe the bug

Building of tdesktop-2.2.0 (Telegram Desktop) on my NixOS unstable system fails with the message:

g++: error: unrecognized command line option '-Xarch_x86_64'; did you mean '-march=x86-64'?

Notify maintainers

@primeos @abbradar

Metadata

  • system: "x86_64-linux"
  • host os: Linux 5.7.12, NixOS, 20.09.git.4254de4a41f (Nightingale)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.7
  • channels(root): "nixos-20.09pre237279.8e2b14aceb1"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: tdesktop
# a list of nixos modules affected by the problem
module:
@primeos
Copy link
Member

primeos commented Aug 8, 2020

Failing Hydra build: https://hydra.nixos.org/build/124793339

This is most likely due to the same problem as in #93761 (comment) and should affect multiple packages.

From the investigation of @orivej it seems to be caused by a recent CMake update (#93886).

@orivej
Copy link
Contributor

orivej commented Aug 8, 2020

Yes, I expect that all CMake packages that use target_precompile_headers are affected. (Very few I suppose, since this feature was added in CMake 3.16.) Currently I'm bisecting CMake.

@primeos
Copy link
Member

primeos commented Aug 8, 2020

@orivej I had a quick look at the Git history of CMake and https://gitlab.kitware.com/cmake/cmake/-/commit/f593b354da2e9637e9b869688934f0ba2544ebed?expanded=1#6c9f77aa6e8d69a3b0b3ddcff14fb5312faa7b5a_2457_2469 seems like a good candidate.

Anyway, thanks a lot for investigating this ❤️ :)

@orivej
Copy link
Contributor

orivej commented Aug 8, 2020

Indeed, this is caused by https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4561

@primeos
Copy link
Member

primeos commented Aug 8, 2020

So I guess a quick workaround might be to only add the CMAKE_OSX_* variables (especially CMAKE_OSX_ARCHITECTURES) on macOS builds?

And according to https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_ARCHITECTURES.html it should also be a CMake bug as it states:

This variable is ignored on platforms other than Apple.

@orivej
Copy link
Contributor

orivej commented Aug 8, 2020

Yes. I have reported it at https://gitlab.kitware.com/cmake/cmake/-/issues/21072

@primeos
Copy link
Member

primeos commented Aug 8, 2020

I've pushed e798793 as a temporary quick-fix for the tdesktop build.

@primeos primeos changed the title tdesktop does not build on nixpkg unstable CMake builds fail with invalid gcc flag "-Xarch_x86_64" on Linux Aug 8, 2020
@primeos primeos changed the title CMake builds fail with invalid gcc flag "-Xarch_x86_64" on Linux Some builds fail with invalid gcc flag "-Xarch_x86_64" (Linux+CMake+PCH) Aug 8, 2020
doronbehar added a commit to doronbehar/nixpkgs that referenced this issue Aug 10, 2020
@samuelgrf
Copy link
Member

The fix for this issue was just merged into CMake master: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5118

@doronbehar
Copy link
Contributor

Let's keep this open for anyone else stumbling such issues, until staging is merged to channels.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/installing-audacity/8575/2

primeos pushed a commit that referenced this issue Aug 22, 2020
@FRidh FRidh closed this as completed in 57f0574 Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants