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

fix binutils on darwin when cross compiling #68399

Closed
wants to merge 1 commit into from

Conversation

angerman
Copy link
Contributor

@angerman angerman commented Sep 10, 2019

We can not compile binutils on darwin when cross compiling,
as compiling gold results in a compilation error like the following:

gold-threads.cc:288:13: error: expected expression
    : once_(PTHREAD_ONCE_INIT)
            ^
/usr/include/pthread.h:210:27: note: expanded from macro 'PTHREAD_ONCE_INIT'
#define PTHREAD_ONCE_INIT {_PTHREAD_ONCE_SIG_init, {0}}

This change adds CXXFLAGS="-std=c++11 -Wno-c++11-narrowing" when
cross compiling binutils on darwin to silence the error. For reference see
the upstream bug report at https://sourceware.org/bugzilla/show_bug.cgi?id=23424

@FRidh
Copy link
Member

FRidh commented Sep 10, 2019

The commit message is not correct. Better describe what the change set fixes and why.

@lheckemann
Copy link
Member

Is this only an issue on 19.03?

@angerman angerman changed the title fix binutils fix binutils on darwin when cross compiling Sep 11, 2019
@angerman
Copy link
Contributor Author

@FRidh extended the description.

@lheckemann I doubt this is 19.03 specific.

@bjornfor bjornfor added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Oct 6, 2019
@angerman
Copy link
Contributor Author

against master now.

@ofborg ofborg bot added 6.topic: darwin Running or building packages on Darwin 6.topic: emacs 6.topic: erlang 6.topic: fetch 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: golang 6.topic: haskell 6.topic: lua labels Oct 17, 2019
@angerman
Copy link
Contributor Author

Meta check here is also not very informative:

nix-env failed:

@angerman
Copy link
Contributor Author

@ofborg eval

@Ericson2314
Copy link
Member

Ericson2314 commented Oct 18, 2019

Can we do this for all platforms against the staging branch?

@ttuegel ttuegel removed their request for review October 20, 2019 17:57
@angerman
Copy link
Contributor Author

Can we do this for all platforms against the staging branch?

what do you want me to do exactly?

@Ericson2314
Copy link
Member

  1. Change the target branch to staging rather than master. Rebase accordingly to not drag in unrelated commits.

  2. Delete the } // lib.optionalAttrs (stdenv.targetPlatform != stdenv.hostPlatform && stdenv.buildPlatform.isDarwin) { line so CXXFLAGS is always set.

@infinisil
Copy link
Member

Btw you can do git fetch upstream && git rebase --onto $(git merge-base upstream/master upstream/staging) HEAD~1 (or so) before switching braches to not have all kinds of commits added and pinging all the people :)

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@veprbl
Copy link
Member

veprbl commented Mar 23, 2021

AFAIK this is not a problem anymore

@veprbl veprbl closed this Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on 6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 1-10 10.rebuild-linux: 0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants