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

[wip] p4v: 2017.3.1601999 -> 2020.1.1946989 #86078

Closed
wants to merge 1 commit into from

Conversation

nioncode
Copy link
Member

Motivation for this change

Updating the p4v version to get rid of openssl_1_0_2.

Unfortunately, this does not work. When running p4merge -V, the following error is printed:

$ p4merge -V
/nix/store/q9xqk2ysx5vd7q8qh5msklq9jwcfn9bh-p4v-2020.1.1946989/bin/p4merge.bin: symbol lookup error: /nix/store/q9xqk2ysx5vd7q8qh5msklq9jwcfn9bh-p4v-2020.1.1946989/bin/p4merge.bin: undefined symbol: _ZNSt20bad_array_new_lengthD1Ev, version Qt_5

When I use the whole /lib folder as provided by upstream, then it works, but obviously it does not use the system Qt version then and I don't know what effects this might have.

@ttuegel can you help me out here what the problem might be?

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

qtscript
qtsensors
qtwebengine
Copy link
Member

Choose a reason for hiding this comment

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

Any chance this already works without qtwebkit?

Copy link
Member Author

Choose a reason for hiding this comment

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

Upstream ships libQt5WebKit.so and libQt5WebEngine.so, so I guess both are needed.

@veprbl
Copy link
Member

veprbl commented Apr 26, 2020

@nioncode You might need to recompile the C++ standard library (stdenv.cc.cc.lib) with versioned symbols. I think, this could help http://anadoxin.org/blog/control-over-symbol-exports-in-gcc.html, see "Using `ld' linker version script".

@veprbl
Copy link
Member

veprbl commented Apr 26, 2020

@nioncode
Copy link
Member Author

@veprbl thanks, but I'm not sure how I could compile or use a different stdenv in the derivation. Also, to me it looks like the problem is not in the stdenv, but in the Qt libraries, since it works when I use the pre-built libraries shipped by upstream (which does not include libstdc++.so.6).

Maybe the Qt libraries have to be compiled with different flags or version information? Do you have an idea how to do this?

@veprbl
Copy link
Member

veprbl commented Apr 27, 2020

The symbol is from the C++ standard library

# echo _ZNSt20bad_array_new_lengthD1Ev | c++filt
std::bad_array_new_length::~bad_array_new_length()

You can check with nm for which library is exporting it.

@nioncode
Copy link
Member Author

Looks like it is properly exported:

$ nm -D /nix/store/n587ax9k9rc5cxm66aiibsss60pqk6b4-gcc-9.3.0-lib/lib/libstdc++.so.6 | grep _ZNSt20bad_array_new_lengthD1Ev
00000000000ac730 T _ZNSt20bad_array_new_lengthD1Ev

The store path is what is written in the p4merge.bin wrapper as LD_LIBRARY_PATH, so this should be the correct library.

But it looks like the Qt libraries are expecting something with version Qt_5 in the symbol and I don't know what this means or how to change the Qt libraries to not require this.

@nioncode
Copy link
Member Author

nioncode commented Apr 27, 2020

I think the p4v tools actually have this version stored in them, e.g.:

$ objdump -T ../bin/p4merge.bin | grep _ZNSt20bad_array_new_lengthD1Ev
0000000000000000      DF *UND*	0000000000000000  Qt_5        _ZNSt20bad_array_new_lengthD1Ev

And their shipped copies of the Qt libraries seem to provide the symbol:

$ objdump -t libQt5Gui.so.5 | grep _ZNSt20bad_array_new_lengthD1Ev
000000000049df60 g     F .text	0000000000000013              _ZNSt20bad_array_new_lengthD1Ev

However, the Qt libraries in my nix store don't provide the symbol:

$ objdump -t /nix/store/prn6sy8qlgppg3yzb16c7vng2fya1axq-qtbase-5.12.7/lib/libQt5Gui.so | grep _ZNSt20bad_array_new_lengthD1Ev

Can we somehow patch the p4v binaries to remove the version Qt_5 requirement of the symbol so that it can be properly supplied by libstdc++ instead of the Qt libraries that seem to not have it?

@corngood
Copy link
Contributor

I was able to get it working with:

corngood@7682a66

which includes this change to patchelf:

NixOS/patchelf#226

@corngood
Copy link
Contributor

I cleaned it up a bit and made #95748.

@nioncode
Copy link
Member Author

Dropping in favor of #95748

@nioncode nioncode closed this Aug 18, 2020
@nioncode nioncode deleted the p4v branch August 18, 2020 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants