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
gcc-arm-embedded: 6-2017-q2-update -> 7-2018-q2-update #47542
Conversation
I would suggest the inclusion of this change into 18-09 as well. |
nox-review pr 47542 on NixOS
|
@@ -6744,7 +6744,8 @@ with pkgs; | |||
ncurses = pkgsi686Linux.ncurses5; | |||
}; | |||
gcc-arm-embedded-6 = callPackage ../development/compilers/gcc-arm-embedded/6 {}; | |||
gcc-arm-embedded = gcc-arm-embedded-6; | |||
gcc-arm-embedded-7 = callPackage ../development/compilers/gcc-arm-embedded/7 {}; | |||
gcc-arm-embedded = gcc-arm-embedded-7; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like there are some breakages. perhaps we could keep this at 6 for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in eaa8bb5be5e7b41ff1fe4aa6bc104c010ccfe1f8
1c32e83
to
eaa8bb5
Compare
@tomberek addressed in eaa8bb5be5e7b41ff1fe4aa6bc104c010ccfe1f8 by keeping the default to gcc-arm-embedded-6. Cleaner option would be set 7 as default and fix the packages built using gcc-arm-embedded, there are not too many (gnuk, blackmagic, betaflight, inav, opentx, axoloti), but I don't want to touch other's people packages now as I am quite new to this. Third option is to set dependencies of mentioned packages to "gcc-arm-embedded-6" instead of "gcc-arm-embedded". What do you think? |
sounds good to me |
Provide feedback to the other packages so they are aware of the issue and can fix it. People seem to welcome this. |
find $out -type f | while read f; do | ||
patchelf $f > /dev/null 2>&1 || continue | ||
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true | ||
patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using autoPatchelfHook. This will make updating a bit easier and is more robust then the approach chosen here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding all libraries to buildInputs will enable the hook to add it to the RPATH.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From your comments, I figured out I should do the following, but should I also modify the find
in preFixup
or remove the preFixup
completely (+ removing fixupPhase
from phases
)? Sorry, I'm quite new to this :-)
--- a/pkgs/development/compilers/gcc-arm-embedded/7/default.nix
+++ b/pkgs/development/compilers/gcc-arm-embedded/7/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses5, python27 }:
+{ stdenv, fetchurl, ncurses5, python27, autoPatchelfHook }:
stdenv.mkDerivation rec {
name = "gcc-arm-embedded-${version}";
@@ -24,6 +24,10 @@ stdenv.mkDerivation rec {
cp -r * $out
'';
+ nativeBuildInputs = [ autoPatchelfHook ];
+
+ buildInputs = [ stdenv.cc.cc ncurses5 python27 ];
+
dontPatchELF = true;
dontStrip = true;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the best case preFixup
should become unnecessary. You can also remove the explicit phases
assignment, it actually a bit of an anti-pattern to skip phases since users might expect them. You only ever need to specify an installPhase unless there is an make install
. dontPatchELF
and dontStrip
can also go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unable to get the build working using the changes you suggest, but I pushed them to a separate gcc-arm-embedded_autopatchelfhook
branch, so I can return to that later. I don't want to dig into this any further, I just want to update the package and fix the blackmagic
breakage for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @dezgeg it currently fails on
$ patchelf --remove-rpath /nix/store/0bvwvmaz3rd8iz3zc3vyclwid0sfbbhg-gcc-arm-embedded-7-2018-q2-update/arm-none-eabi/lib/redboot-crt0.o
wrong ELF type
$ file /nix/store/0bvwvmaz3rd8iz3zc3vyclwid0sfbbhg-gcc-arm-embedded-7-2018-q2-update/arm-none-eabi/lib/redboot-crt0.o
/nix/store/0bvwvmaz3rd8iz3zc3vyclwid0sfbbhg-gcc-arm-embedded-7-2018-q2-update/arm-none-eabi/lib/redboot-crt0.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped
https://dl.thalheim.io/e2GdCQGJnobRgFI7F3B73w/auto-patchelf-hook-error.log
I thought I saw some architecture related code in the hook. But I suppose this is not handled yet right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose that's the reason why it is handled manually in the original script and failures are silently skipped. We don't want to patch stuff that is part of the package, such as lib/redboot-crt0.o
which is ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped and thus should not be processed via patchElf.
eaa8bb5
to
4b4e256
Compare
@tomberek I was able to investigate the gcc-arm-embedded-7 compatibility further and found out that the only package that failed with the new gcc-arm-embedded-7 is |
@prusnak Sound good to me. Thanks for updating blackmagic. |
4b4e256
to
04604e0
Compare
|
||
urlString = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-linux.tar.bz2"; | ||
|
||
src = fetchurl { url=urlString; sha256="0sgysp3hfpgrkcbfiwkp0a7ymqs02khfbrjabm52b5z61sgi05xv"; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing ;
is missing.
src = fetchurl {
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-linux.tar.bz2";
sha256="0sgysp3hfpgrkcbfiwkp0a7ymqs02khfbrjabm52b5z61sgi05xv";
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b3531b9
+ update blackmagic to latest commit which includes gcc7 fixes
04604e0
to
b3531b9
Compare
Thanks! |
@Mic92 Thanks for the merge. What is the correct process to get this into 18.09 release? |
I don't think we should backport |
Use |
Motivation for this change
gcc-arm-embedded was not updated since mid-2017, this update brings the package to the latest possible version
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)