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

QT5.6: Fixes compile error with wrong LD env variable #27940

Merged
merged 1 commit into from Aug 7, 2017

Conversation

bkchr
Copy link
Contributor

@bkchr bkchr commented Aug 4, 2017

QT uses -Wl linker flags and these flags only work with gcc/g++
and not with LD directly.

Motivation for this change
Things done

Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers.

  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@@ -103,6 +103,8 @@ stdenv.mkDerivation {
preConfigure = ''
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms:$LD_LIBRARY_PATH"
export MAKEFLAGS=-j$NIX_BUILD_CORES
// We need to set LD to GCC or otherwise we get nasty compile errors
export LD=$GCC
Copy link
Member

Choose a reason for hiding this comment

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

This shoukd be $CC otherwise this will break with clang

@bkchr
Copy link
Contributor Author

bkchr commented Aug 5, 2017

Fixed :)

@NeQuissimus NeQuissimus added 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on 8.has: package (update) labels Aug 5, 2017
Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

Still seems to fail with

/build/qtbase-opensource-src-5.6.2/lib/libQt5Bootstrap.a(qlatincodec.o):(.data.rel.ro._ZTI12QLatin1Codec[_ZTI12QLatin1Codec]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/build/qtbase-opensource-src-5.6.2/lib/libQt5Bootstrap.a(qlatincodec.o):(.data.rel.ro._ZTI13QLatin15Codec[_ZTI13QLatin15Codec]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
collect2: error: ld returned 1 exit status

@@ -103,6 +103,8 @@ stdenv.mkDerivation {
preConfigure = ''
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms:$LD_LIBRARY_PATH"
export MAKEFLAGS=-j$NIX_BUILD_CORES
// We need to set LD to CC or otherwise we get nasty compile errors
Copy link
Member

Choose a reason for hiding this comment

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

invalid comment, #

QT uses -Wl linker flags and these flags only work with gcc/g++
and not with LD directly.
@bkchr
Copy link
Contributor Author

bkchr commented Aug 7, 2017

Now it finally should work! First I hard $GCC and replaced that with $CC, but it needed to be $CXX. :) On my laptop it compiled now with my latest commit.

@FRidh FRidh merged commit e7651e4 into NixOS:master Aug 7, 2017
@bkchr bkchr deleted the fix_qt56_ld branch August 7, 2017 11:28
@FRidh FRidh mentioned this pull request Aug 7, 2017
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different sort platform than than they will be run on 6.topic: qt/kde 8.has: package (update)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants