Merge pull request #309654 from lsix/fix-rocgdb

rocmPackages.rocgdb: Ensure build with AMDPGU support, plus various improvements
This commit is contained in:
lsix 2024-05-22 17:53:58 +01:00 committed by GitHub
commit 41b39e41b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 50 additions and 5 deletions

View File

@ -115,8 +115,7 @@ in rec {
};
rocgdb = callPackage ./rocgdb {
inherit rocmUpdateScript;
elfutils = elfutils.override { enableDebuginfod = true; };
inherit rocmUpdateScript rocdbgapi;
stdenv = llvm.rocmClangStdenv;
};

View File

@ -6,11 +6,16 @@
, texinfo
, bison
, flex
, glibc
, zlib
, elfutils
, gmp
, mpfr
, ncurses
, expat
, rocdbgapi
, python3
, babeltrace
, sourceHighlight
}:
stdenv.mkDerivation (finalAttrs: {
@ -33,12 +38,53 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
zlib
elfutils
gmp
mpfr
ncurses
expat
rocdbgapi
python3
babeltrace
sourceHighlight
];
configureFlags = [
# Ensure we build the amdgpu traget
"--enable-targets=${stdenv.targetPlatform.config},amdgcn-amd-amdhsa"
"--with-amd-dbgapi=yes"
"--with-iconv-path=${glibc.bin}"
"--enable-tui"
"--with-babeltrace"
"--with-python=python3"
"--with-system-zlib"
"--enable-64-bit-bfd"
"--with-gmp=${gmp.dev}"
"--with-mpfr=${mpfr.dev}"
"--with-expat"
"--with-libexpat-prefix=${expat.dev}"
# So the installed binary is called "rocgdb" instead on plain "gdb"
"--program-prefix=roc"
# Disable building many components not used or incompatible with the amdgcn target
"--disable-sim"
"--disable-gdbserver"
"--disable-ld"
"--disable-gas"
"--disable-gdbserver"
"--disable-sim"
"--disable-gdbtk"
"--disable-gprofng"
"--disable-shared"
];
# The source directory for ROCgdb (based on upstream GDB) contains multiple project
# of GNUs toolchain (binutils and onther), we only need to install the GDB part.
installPhase = ''
make install-gdb
'';
# `-Wno-format-nonliteral` doesn't work
env.NIX_CFLAGS_COMPILE = "-Wno-error=format-security";
@ -51,7 +97,7 @@ stdenv.mkDerivation (finalAttrs: {
meta = with lib; {
description = "ROCm source-level debugger for Linux, based on GDB";
homepage = "https://github.com/ROCm/ROCgdb";
license = with licenses; [ gpl2 gpl3 bsd3 ];
license = licenses.gpl3Plus;
maintainers = teams.rocm.members;
platforms = platforms.linux;
broken = versionAtLeast finalAttrs.version "7.0.0";