Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3ffd4b446fbd
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 493f8b2ea291
Choose a head ref
  • 7 commits
  • 24 files changed
  • 2 contributors

Commits on Nov 10, 2020

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    MylesBorins Myles Borins
    Copy the full SHA
    6d8327e View commit details
  2. Copy the full SHA
    46db711 View commit details
  3. binutils: Move patches in versioned dir

    We'll have multiple binutils to contend with.
    samueldr committed Nov 10, 2020
    Copy the full SHA
    dbe556a View commit details
  4. binutils: Add patches for 2.34

    From #89793
    samueldr committed Nov 10, 2020
    Copy the full SHA
    257fb62 View commit details
  5. Copy the full SHA
    c6f6db7 View commit details
  6. Copy the full SHA
    ebd89f6 View commit details

Commits on Nov 11, 2020

  1. Merge pull request #93368 from samueldr/feature/or1k-toolchain

    Initial support for OpenRISC 1000
    Ericson2314 authored Nov 11, 2020
    Copy the full SHA
    493f8b2 View commit details
Showing with 332 additions and 22 deletions.
  1. +2 −0 lib/systems/doubles.nix
  2. +6 −0 lib/systems/examples.nix
  3. +1 −0 lib/systems/inspect.nix
  4. +2 −0 lib/systems/parse.nix
  5. +1 −0 pkgs/build-support/bintools-wrapper/default.nix
  6. +1 −1 pkgs/development/libraries/libbfd/default.nix
  7. +1 −1 pkgs/development/libraries/libopcodes/default.nix
  8. +36 −0 pkgs/development/misc/or1k/newlib.nix
  9. +45 −20 pkgs/development/tools/misc/binutils/default.nix
  10. 0 ...s/misc/binutils/{ → patches/2.31}/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
  11. 0 ...pment/tools/misc/binutils/{ → patches/2.31}/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
  12. 0 ...t/tools/misc/binutils/{ → patches/2.31}/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
  13. 0 pkgs/development/tools/misc/binutils/{ → patches/2.31}/always-search-rpath.patch
  14. 0 pkgs/development/tools/misc/binutils/{ → patches/2.31}/build-components-separately.patch
  15. 0 pkgs/development/tools/misc/binutils/{ → patches/2.31}/deterministic.patch
  16. 0 pkgs/development/tools/misc/binutils/{ → patches/2.31}/disambiguate-arm-targets.patch
  17. 0 pkgs/development/tools/misc/binutils/{ → patches/2.31}/gold-symbol-visibility.patch
  18. 0 pkgs/development/tools/misc/binutils/{ → patches/2.31}/no-plugins.patch
  19. +14 −0 pkgs/development/tools/misc/binutils/patches/2.34/always-search-rpath.patch
  20. +164 −0 pkgs/development/tools/misc/binutils/patches/2.34/build-components-separately.patch
  21. +12 −0 pkgs/development/tools/misc/binutils/patches/2.34/deterministic.patch
  22. +23 −0 pkgs/development/tools/misc/binutils/patches/2.34/disambiguate-arm-targets.patch
  23. +21 −0 pkgs/development/tools/misc/binutils/patches/2.34/no-plugins.patch
  24. +3 −0 pkgs/top-level/all-packages.nix
2 changes: 2 additions & 0 deletions lib/systems/doubles.nix
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ let
"msp430-none"
"riscv64-none" "riscv32-none"
"vc4-none"
"or1k-none"

"js-ghcjs"

@@ -58,6 +59,7 @@ in {
mips = filterDoubles predicates.isMips;
riscv = filterDoubles predicates.isRiscV;
vc4 = filterDoubles predicates.isVc4;
or1k = filterDoubles predicates.isOr1k;
js = filterDoubles predicates.isJavaScript;

bigEndian = filterDoubles predicates.isBigEndian;
6 changes: 6 additions & 0 deletions lib/systems/examples.nix
Original file line number Diff line number Diff line change
@@ -124,6 +124,12 @@ rec {
platform = {};
};

or1k = {
config = "or1k-elf";
libc = "newlib";
platform = {};
};

arm-embedded = {
config = "arm-none-eabi";
libc = "newlib";
1 change: 1 addition & 0 deletions lib/systems/inspect.nix
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ rec {
isVc4 = { cpu = { family = "vc4"; }; };
isAvr = { cpu = { family = "avr"; }; };
isAlpha = { cpu = { family = "alpha"; }; };
isOr1k = { cpu = { family = "or1k"; }; };
isJavaScript = { cpu = cpuTypes.js; };

is32bit = { cpu = { bits = 32; }; };
2 changes: 2 additions & 0 deletions lib/systems/parse.nix
Original file line number Diff line number Diff line change
@@ -114,6 +114,8 @@ rec {

vc4 = { bits = 32; significantByte = littleEndian; family = "vc4"; };

or1k = { bits = 32; significantByte = bigEndian; family = "or1k"; };

js = { bits = 32; significantByte = littleEndian; family = "js"; };
};

1 change: 1 addition & 0 deletions pkgs/build-support/bintools-wrapper/default.nix
Original file line number Diff line number Diff line change
@@ -185,6 +185,7 @@ stdenv.mkDerivation {
else if targetPlatform.isAvr then "avr"
else if targetPlatform.isAlpha then "alpha"
else if targetPlatform.isVc4 then "vc4"
else if targetPlatform.isOr1k then "or1k"
else throw "unknown emulation for platform: ${targetPlatform.config}";
in if targetPlatform.useLLVM or false then ""
else targetPlatform.platform.bfdEmulation or (fmt + sep + arch);
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libbfd/default.nix
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
outputs = [ "out" "dev" ];

patches = binutils-unwrapped.patches ++ [
../../tools/misc/binutils/build-components-separately.patch
(binutils-unwrapped.patchesDir + "/build-components-separately.patch")
(fetchpatch {
url = "https://raw.githubusercontent.com/mxe/mxe/e1d4c144ee1994f70f86cf7fd8168fe69bd629c6/src/bfd-1-disable-subdir-doc.patch";
sha256 = "0pzb3i74d1r7lhjan376h59a7kirw15j7swwm8pz3zy9lkdqkj6q";
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libopcodes/default.nix
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
outputs = [ "out" "dev" ];

patches = binutils-unwrapped.patches ++ [
../../tools/misc/binutils/build-components-separately.patch
(binutils-unwrapped.patchesDir + "/build-components-separately.patch")
];

# We just want to build libopcodes
36 changes: 36 additions & 0 deletions pkgs/development/misc/or1k/newlib.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{ stdenv, texinfo, flex, bison, fetchFromGitHub, crossLibcStdenv, buildPackages }:

crossLibcStdenv.mkDerivation {
name = "newlib";
src = fetchFromGitHub {
owner = "openrisc";
repo = "newlib";
rev = "8ac94ca7bbe4ceddafe6583ee4766d3c15b18ac8";
sha256 = "0hzhijmry5slpp6x12pgng8v7jil3mn18ahrhnw431lqrs1cma0s";
};

depsBuildBuild = [ buildPackages.stdenv.cc ];

# newlib expects CC to build for build platform, not host platform
preConfigure = ''
export CC=cc
'';

configurePlatforms = [ "build" "target" ];
configureFlags = [
"--host=${stdenv.buildPlatform.config}"

"--disable-newlib-supplied-syscalls"
"--disable-nls"
"--enable-newlib-io-long-long"
"--enable-newlib-register-fini"
"--enable-newlib-retargetable-locking"
];

dontDisableStatic = true;

passthru = {
incdir = "/${stdenv.targetPlatform.config}/include";
libdir = "/${stdenv.targetPlatform.config}/lib";
};
}
65 changes: 45 additions & 20 deletions pkgs/development/tools/misc/binutils/default.nix
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
, bison ? null
, flex
, texinfo
, perl
}:

# Note: this package is used for bootstrapping fetchurl, and thus
@@ -21,7 +22,10 @@ let
# Remove gold-symbol-visibility patch when updating, the proper fix
# is now upstream.
# https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=330b90b5ffbbc20c5de6ae6c7f60c40fab2e7a4f;hp=99181ccac0fc7d82e7dabb05dc7466e91f1645d3
version = "2.31.1";
version = "${minorVersion}${patchVersion}";
minorVersion = if stdenv.targetPlatform.isOr1k then "2.34" else "2.31";
patchVersion = if stdenv.targetPlatform.isOr1k then "" else ".1";

basename = "binutils";
# The targetPrefix prepended to binary names to allow multiple binuntils on the
# PATH to both be usable.
@@ -33,59 +37,80 @@ let
rev = "708acc851880dbeda1dd18aca4fd0a95b2573b36";
sha256 = "1kdrz6fki55lm15rwwamn74fnqpy0zlafsida2zymk76n3656c63";
};
# HACK to ensure that we preserve source from bootstrap binutils to not rebuild LLVM
normal-src = stdenv.__bootPackages.binutils-unwrapped.src or (fetchurl {

# binutils sources not part of the bootstrap.
non-boot-src = (fetchurl {
url = "mirror://gnu/binutils/${basename}-${version}.tar.bz2";
sha256 = "1l34hn1zkmhr1wcrgf0d4z7r3najxnw3cx2y2fk7v55zjlk3ik7z";
sha256 = {
"2.31.1" = "1l34hn1zkmhr1wcrgf0d4z7r3najxnw3cx2y2fk7v55zjlk3ik7z";
"2.34" = "1rin1f5c7wm4n3piky6xilcrpf2s0n3dd5vqq8irrxkcic3i1w49";
}.${version};
});

# HACK to ensure that we preserve source from bootstrap binutils to not rebuild LLVM
normal-src = stdenv.__bootPackages.binutils-unwrapped.src or non-boot-src;

# Platforms where we directly use the final source.
# Generally for cross-compiled platforms, where the boot source won't compile.
skipBootSrc = stdenv.targetPlatform.isOr1k;

# Select the specific source according to the platform in use.
src = if stdenv.targetPlatform.isVc4 then vc4-binutils-src
else if skipBootSrc then non-boot-src
else normal-src;

patchesDir = ./patches + "/${minorVersion}";
in

stdenv.mkDerivation {
pname = targetPrefix + basename;
inherit version;

src = if stdenv.targetPlatform.isVc4 then vc4-binutils-src else normal-src;
inherit src version;

patches = [
# Make binutils output deterministic by default.
./deterministic.patch
"${patchesDir}/deterministic.patch"

# Bfd looks in BINDIR/../lib for some plugins that don't
# exist. This is pointless (since users can't install plugins
# there) and causes a cycle between the lib and bin outputs, so
# get rid of it.
./no-plugins.patch
"${patchesDir}/no-plugins.patch"

# Help bfd choose between elf32-littlearm, elf32-littlearm-symbian, and
# elf32-littlearm-vxworks in favor of the first.
# https://github.com/NixOS/nixpkgs/pull/30484#issuecomment-345472766
./disambiguate-arm-targets.patch
"${patchesDir}/disambiguate-arm-targets.patch"

# For some reason bfd ld doesn't search DT_RPATH when cross-compiling. It's
# not clear why this behavior was decided upon but it has the unfortunate
# consequence that the linker will fail to find transitive dependencies of
# shared objects when cross-compiling. Consequently, we are forced to
# override this behavior, forcing ld to search DT_RPATH even when
# cross-compiling.
./always-search-rpath.patch

] ++ lib.optionals (!stdenv.targetPlatform.isVc4)
[
"${patchesDir}/always-search-rpath.patch"
]
# For version 2.31 exclusively
++ lib.optionals (!stdenv.targetPlatform.isVc4 && minorVersion == "2.31") [
# https://sourceware.org/bugzilla/show_bug.cgi?id=22868
./gold-symbol-visibility.patch
./patches/2.31/gold-symbol-visibility.patch

# https://sourceware.org/bugzilla/show_bug.cgi?id=23428
# un-break features so linking against musl doesn't produce crash-only binaries
./0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
./0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
./0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
] ++ lib.optional stdenv.targetPlatform.isiOS ./support-ios.patch;
./patches/2.31/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
./patches/2.31/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
./patches/2.31/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
]
++ lib.optional stdenv.targetPlatform.isiOS ./support-ios.patch
;

outputs = [ "out" "info" "man" ];

depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [
bison
] ++ lib.optionals (lib.versionAtLeast version "2.34") [
perl
texinfo
] ++ (lib.optionals stdenv.targetPlatform.isiOS [
autoreconfHook
]) ++ lib.optionals stdenv.targetPlatform.isVc4 [ texinfo flex ];
@@ -149,7 +174,7 @@ stdenv.mkDerivation {
enableParallelBuilding = true;

passthru = {
inherit targetPrefix;
inherit targetPrefix patchesDir;
};

meta = with lib; {
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/ld/genscripts.sh b/ld/genscripts.sh
index b6940d376d..0feb1adfd0 100755
--- a/ld/genscripts.sh
+++ b/ld/genscripts.sh
@@ -125,6 +125,9 @@ if test "x$NATIVE" = "xyes" ; then
USE_LIBPATH=yes
fi

+# TODO: why is this needed?
+USE_LIBPATH=yes
+
# Set the library search path, for libraries named by -lfoo.
# If LIB_PATH is defined (e.g., by Makefile) and non-empty, it is used.
# Otherwise, the default is set here.
Loading