binutils: consolidate plugin-api.h support in a single

I got the plugin API support at least once incorrect. Instead of
copying the deifnition let's consolidate it within binutils itself.

While at it forward-ported changes to llvm_{13,14,15}.
The change is a no-op from rebuild perspective.
This commit is contained in:
Sergei Trofimovich 2023-01-30 19:21:05 +00:00
parent 106af1cb72
commit b9a9dfc3d4
14 changed files with 18 additions and 13 deletions

View File

@ -5,7 +5,7 @@
, cmake
, python3
, libffi
, enableGoldPlugin ? (!stdenv.isDarwin && !stdenv.targetPlatform.isWasi)
, enableGoldPlugin ? libbfd.hasPluginAPI
, libbfd
, libpfm
, libxml2

View File

@ -5,7 +5,7 @@
, cmake
, python3
, libffi
, enableGoldPlugin ? (!stdenv.isDarwin && !stdenv.targetPlatform.isWasi)
, enableGoldPlugin ? libbfd.hasPluginAPI
, libbfd
, libpfm
, libxml2

View File

@ -5,7 +5,7 @@
, cmake
, python3
, libffi
, enableGoldPlugin ? (!stdenv.isDarwin && !stdenv.targetPlatform.isWasi)
, enableGoldPlugin ? libbfd.hasPluginAPI
, libbfd
, libpfm
, libxml2

View File

@ -5,6 +5,7 @@
, cmake
, python3
, libffi
, enableGoldPlugin ? libbfd.hasPluginAPI
, libbfd
, libpfm
, libxml2
@ -153,7 +154,7 @@ in stdenv.mkDerivation (rec {
"-DSPHINX_OUTPUT_MAN=ON"
"-DSPHINX_OUTPUT_HTML=OFF"
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
] ++ optionals (!isDarwin) [
] ++ optionals (enableGoldPlugin) [
"-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
] ++ optionals isDarwin [
"-DLLVM_ENABLE_LIBCXX=ON"

View File

@ -6,6 +6,7 @@
, cmake
, python3
, libffi
, enableGoldPlugin ? libbfd.hasPluginAPI
, libbfd
, libpfm
, libxml2
@ -165,7 +166,7 @@ in stdenv.mkDerivation (rec {
"-DSPHINX_OUTPUT_MAN=ON"
"-DSPHINX_OUTPUT_HTML=OFF"
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
] ++ optionals (!isDarwin) [
] ++ optionals (enableGoldPlugin) [
"-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
] ++ optionals isDarwin [
"-DLLVM_ENABLE_LIBCXX=ON"

View File

@ -9,6 +9,7 @@
, python3
, python3Packages
, libffi
, enableGoldPlugin ? libbfd.hasPluginAPI
, libbfd
, libpfm
, libxml2
@ -327,7 +328,7 @@ in stdenv.mkDerivation (rec {
"-DSPHINX_OUTPUT_MAN=ON"
"-DSPHINX_OUTPUT_HTML=OFF"
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
] ++ optionals (!isDarwin) [
] ++ optionals (enableGoldPlugin) [
"-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
] ++ optionals isDarwin [
"-DLLVM_ENABLE_LIBCXX=ON"

View File

@ -5,7 +5,7 @@
, cmake
, python3
, libffi
, enableGoldPlugin ? (!stdenv.isDarwin && !stdenv.targetPlatform.isWasi)
, enableGoldPlugin ? libbfd.hasPluginAPI
, libbfd
, libxml2
, ncurses

View File

@ -4,7 +4,7 @@
, cmake
, python3
, libffi
, enableGoldPlugin ? (!stdenv.isDarwin && !stdenv.targetPlatform.isWasi)
, enableGoldPlugin ? libbfd.hasPluginAPI
, libbfd
, libxml2
, ncurses

View File

@ -5,7 +5,7 @@
, cmake
, python3
, libffi
, enableGoldPlugin ? (!stdenv.isDarwin && !stdenv.targetPlatform.isWasi)
, enableGoldPlugin ? libbfd.hasPluginAPI
, libbfd
, libpfm
, libxml2

View File

@ -5,7 +5,7 @@
, cmake
, python3
, libffi
, enableGoldPlugin ? (!stdenv.isDarwin && !stdenv.targetPlatform.isWasi)
, enableGoldPlugin ? libbfd.hasPluginAPI
, libbfd
, libpfm
, libxml2

View File

@ -5,7 +5,7 @@
, cmake
, python3
, libffi
, enableGoldPlugin ? (!stdenv.isDarwin && !stdenv.targetPlatform.isWasi)
, enableGoldPlugin ? libbfd.hasPluginAPI
, libbfd
, libpfm
, libxml2

View File

@ -232,6 +232,8 @@ stdenv.mkDerivation (finalAttrs: {
inherit targetPrefix;
hasGold = enableGold;
isGNU = true;
# Having --enable-plugins is not enough, system has to support dlopen()
hasPluginAPI = enableGold && !stdenv.isDarwin && !stdenv.targetPlatform.isWasi;
};
meta = with lib; {

View File

@ -15,7 +15,7 @@ stdenv.mkDerivation {
];
passthru = {
dev = binutils-unwrapped-all-targets.dev;
inherit (binutils-unwrapped-all-targets) dev hasPluginAPI;
};
meta = with lib; {

View File

@ -15,7 +15,7 @@ stdenv.mkDerivation {
];
passthru = {
dev = binutils-unwrapped-all-targets.dev;
inherit (binutils-unwrapped-all-targets) dev hasPluginAPI;
};
meta = with lib; {