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

Revert "Revert "Add mingwW64-llvm cross-system."" #173498

Closed
wants to merge 1 commit into from

Conversation

shlevy
Copy link
Member

@shlevy shlevy commented May 18, 2022

Waiting on next staging cycle to move forward.

This reverts commit c911240.

Waiting on next staging cycle to move forward.

This reverts commit c911240.
@shlevy
Copy link
Member Author

shlevy commented May 31, 2022

@sternenseemann Any sense of when you'll get a chance to review?

Copy link
Member

@sternenseemann sternenseemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks okay to me, but I can't really comment on the libtool patches and haven't tested it.

Doing things for LLVM >= 13 as long as it includes git is okay, may be nice to add it for 11 and 12 as well so it hits our default versions may be nice as well, but not a requirement.

in ''
export mtype=${mtype}
substituteAll ${./add-lld-ldflags-before.sh} add-local-ldflags-before.sh
cat add-local-ldflags-before.sh >> $out/nix-support/add-local-ldflags-before.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the other writes to $out/nix-support/add-local-ldflags-before.sh to append as well? I'm a bit concerned that somebody starts overwriting additions accidentally by reordering code in here.

preferLocalBuild = true;
passthru = {
isLld = true;
targetPrefix = prefix;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't the other LLVM versions have a targetPrefix passthru now?

'' + lib.optionalString stdenv.targetPlatform.isWindows ''
ln -s ${llvm}/bin/llvm-windres $out/bin/${prefix}windres
ln -s ${llvm}/bin/llvm-dlltool $out/bin/${prefix}dlltool
'')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this relevant to other LLVM versions as well? Note that unless you add any changes to llvmPackages 14 and llvmPackages_git, it'll likely get lost in the future.

./0012-Prefer-response-files-over-linker-scripts-for-mingw-.patch
./0013-Allow-statically-linking-compiler-support-libraries-.patch
./0014-Support-llvm-objdump-f-output.patch
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't say anything w.r.t. these patches. Maybe we can pester @aakropotkin about this?

@@ -45,6 +47,8 @@ stdenv.mkDerivation rec {

checkInputs = [ dejagnu ];

nativeBuildInputs = lib.optional stdenv.hostPlatform.isWindows autoreconfHook;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment why this is needed? I.e. is this a structural problem or will this fix itself in a future libffi release?

@@ -29,7 +29,7 @@ let self = stdenv.mkDerivation rec {
passthru.static = self.out;

depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ m4 ];
nativeBuildInputs = [ m4 ] ++ lib.optional stdenv.hostPlatform.isWindows autoreconfHook;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment why this is needed? I.e. is this a structural problem or will this fix itself in a future gmp release?

"-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=TRUE"
"-DLIBCXX_CXX_ABI_LIBRARY_PATH=${libcxxabi}/lib"
] ++ lib.optional (!headersOnly && libcxxabi.useLLVMUnwinder)
"-DLIBCXXABI_USE_LLVM_UNWINDER=ON";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still confused about this one…


stdenv.mkDerivation rec {
enableShared' = enableShared && !semi-static;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe onlyEnableShared is clearer?

@aakropotkin
Copy link
Contributor

aakropotkin commented May 31, 2022 via email

@shlevy
Copy link
Member Author

shlevy commented May 31, 2022

Here's the thread with the patches upstream that @aakropotkin mentions https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27866

@sternenseemann
Copy link
Member

Well, we definitely can't apply libtool patches that have been rejected upstream and cause incorrect behavior in some cases. If they are indeed required for mingw64-llvm cross, we should make them conditional to that platform. Unfortunately this means someone needs to keep an eye on cross-trunk whenever libtool is updated.

@aakropotkin
Copy link
Contributor

aakropotkin commented Jun 1, 2022 via email

@Ericson2314
Copy link
Member

Having interacted with some of the LLVM people there and you all, I would be happy to convene some meeting and hash out how things ought to work, if this a case of everyone hacking around each other.

@aakropotkin
Copy link
Contributor

aakropotkin commented Jun 1, 2022 via email

@shlevy shlevy marked this pull request as draft June 2, 2022 11:18
@shlevy
Copy link
Member Author

shlevy commented Jun 2, 2022

Draft until I can conditionalize libtool patches and respond to other comments.

@rrbutani rrbutani mentioned this pull request Nov 7, 2022
92 tasks
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 8, 2023
@shlevy shlevy closed this Feb 2, 2024
@Ericson2314
Copy link
Member

Did this get done in the meantime or something?

@shlevy
Copy link
Member Author

shlevy commented Feb 5, 2024

No, too much complexity to finish quickly and the work project got cancelled.

@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
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: haskell 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 10.rebuild-darwin: 501+ 10.rebuild-darwin: 5001+ 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ 10.rebuild-linux-stdenv This PR causes stdenv to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants