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

llvmPackages: use libcxxrt on FreeBSD #211230

Merged
merged 3 commits into from
Jan 24, 2023
Merged

llvmPackages: use libcxxrt on FreeBSD #211230

merged 3 commits into from
Jan 24, 2023

Conversation

alyssais
Copy link
Member

Description of changes

FreeBSD doesn't use LLVM's cxxabi implementation, for backwards compatibility reasons. Software expects the libcxxrt API when building on FreeBSD. This fixes the build of pkgsCross.x86_64-freebsd.boost.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@alyssais alyssais added the 6.topic: bsd Running or building packages on BSD label Jan 17, 2023
@alyssais alyssais marked this pull request as draft January 17, 2023 12:23
@alyssais
Copy link
Member Author

Eval is failing because of LLVMs 5 and 6 again. >:(

@alyssais
Copy link
Member Author

Huh, I guess this doesn't really need to target staging.

@alyssais alyssais changed the base branch from staging to master January 19, 2023 18:17
@alyssais alyssais force-pushed the libcxxrt branch 2 times, most recently from 99edc9e to 4b83d46 Compare January 20, 2023 13:08
@alyssais alyssais marked this pull request as ready for review January 20, 2023 16:36
alyssais added a commit to alyssais/nixpkgs that referenced this pull request Jan 22, 2023
Builds fine for NetBSD, will build for FreeBSD once
NixOS#211230 is merged, and the README
mentions some amount of Windows support.
@alyssais alyssais mentioned this pull request Jan 22, 2023
13 tasks
The exception for FreeBSD was added in 0afe9d1 ("freebsd packages:
Init at 13.1"), but it seems to have been erroneous, as e.g. ncurses
fails to build:

	x86_64-unknown-freebsd13-clang++  -o demo ../obj_s/demo.o -L../lib -lncurses++w -L../lib -lformw -lmenuw -lpanelw -lncursesw   -lutil     -DHAVE_CONFIG_H -DBUILDING_NCURSES_CXX -I../c++ -I. -I../include  -DNDEBUG -O2  -fPIC -DPIC
	x86_64-unknown-freebsd13-ld: error: undefined symbol: _Unwind_Resume
	>>> referenced by demo.cc
	>>>               ../obj_s/demo.o:(TestApplication::run())
	>>> referenced by demo.cc
	>>>               ../obj_s/demo.o:(_GLOBAL__sub_I_demo.cc)
	>>> referenced by demo.cc
	>>>               ../obj_s/demo.o:(NCursesUserItem<UserData>::NCursesUserItem(char const*, char const*, UserData const*))
	>>> referenced 46 more times
	clang-12: error: linker command failed with exit code 1 (use -v to see invocation)

This is fixed by undoing the change, adding -lunwind on FreeBSD.
@alyssais
Copy link
Member Author

I've split the -lunwind change into its own commit, since it turns out it's needed independently of the change to libcxxrt. But I don't think there's any point in splitting it into a separate PR.

FreeBSD doesn't use LLVM's cxxabi implementation, for backwards
compatibility reasons.  Software expects the libcxxrt API when
building on FreeBSD.  This fixes the build of
pkgsCross.x86_64-freebsd.boost.
@alyssais
Copy link
Member Author

Updated to be less stringy based on a suggestion from @Ericson2314 on Matrix. We now pass cxxabi around as a package, and look at its pname when necessary to tell them apart, rather than passing a string around and trying to map it back to a packag.

@alyssais alyssais merged commit 2ae30c9 into NixOS:master Jan 24, 2023
@alyssais alyssais deleted the libcxxrt branch January 24, 2023 21:18
@rrbutani rrbutani mentioned this pull request Jan 25, 2023
92 tasks
rrbutani added a commit to rrbutani/nixpkgs that referenced this pull request Jan 27, 2023
See the comments here for context: NixOS#194634 (comment)

Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
github-actions bot pushed a commit that referenced this pull request Jan 28, 2023
See the comments here for context: #194634 (comment)

Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
(cherry picked from commit 4fabcf4)
K900 pushed a commit that referenced this pull request Jan 28, 2023
See the comments here for context: #194634 (comment)

Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
xanderio pushed a commit to xanderio/nixpkgs that referenced this pull request Feb 13, 2023
See the comments here for context: NixOS#194634 (comment)

Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
RaitoBezarius pushed a commit that referenced this pull request Mar 26, 2023
See the comments here for context: #194634 (comment)

Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
RaitoBezarius pushed a commit that referenced this pull request Apr 5, 2023
Port of 4fabcf4 ("llvmPackages_15:
apply #211230 to llvmPackages_15").

See the comments here for context: #194634 (comment)

Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
rrbutani added a commit to rrbutani/nixpkgs that referenced this pull request Apr 5, 2023
Port of 4fabcf4 ("llvmPackages_15:
apply NixOS#211230 to llvmPackages_15").

See the comments here for context: NixOS#194634 (comment)

Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
@ghost ghost mentioned this pull request May 15, 2024
14 tasks
@rrbutani rrbutani added the 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: bsd Running or building packages on BSD 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 6.topic: stdenv Standard environment 8.has: package (new) 10.rebuild-darwin: 11-100 10.rebuild-linux: 11-100
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants