mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 11:36:07 +01:00
update nixpkgs; applyPatches to fix toolchain (nixpkgs!269077)
This commit is contained in:
parent
970a735f56
commit
6daee58791
13 changed files with 80 additions and 28 deletions
16
pkgs/cross-compiling/compiler-rt.patch
Normal file
16
pkgs/cross-compiling/compiler-rt.patch
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
diff --git a/pkgs/development/compilers/llvm/16/compiler-rt/default.nix b/pkgs/d
|
||||
evelopment/compilers/llvm/16/compiler-rt/default.nix
|
||||
index 0f15a9e12cde..a32533e5285c 100644
|
||||
--- a/pkgs/development/compilers/llvm/16/compiler-rt/default.nix
|
||||
+++ b/pkgs/development/compilers/llvm/16/compiler-rt/default.nix
|
||||
@@ -130,8 +130,8 @@ stdenv.mkDerivation {
|
||||
# The presence of crtbegin_shared has been added and removed; it's possible
|
||||
# people have added/removed it to get it working on their platforms.
|
||||
# Try each in turn for now.
|
||||
- ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbeginS.o
|
||||
- ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtendS.o
|
||||
+ #ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbeginS.o
|
||||
+ #ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtendS.o
|
||||
ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o
|
||||
ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o
|
||||
'' + lib.optionalString doFakeLibgcc ''
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ config, nixpkgs, system }:
|
||||
{ config, system }:
|
||||
|
||||
{
|
||||
inherit system;
|
||||
|
|
|
|||
18
pkgs/cross-compiling/cross-pkgs.nix
Normal file
18
pkgs/cross-compiling/cross-pkgs.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ callPackage, nixpkgs, system }:
|
||||
|
||||
let
|
||||
args = callPackage ./cross-pkgs-args.nix { };
|
||||
pkgsCross-imported = import nixpkgs args;
|
||||
pkgsCross-patched = pkgsCross-imported.applyPatches {
|
||||
name = "nixpkgs-crosscompilation-patched";
|
||||
src = nixpkgs;
|
||||
patches = [
|
||||
./compiler-rt.patch
|
||||
./libunwind.patch
|
||||
];
|
||||
};
|
||||
pkgsCross = import pkgsCross-patched args;
|
||||
in
|
||||
pkgsCross
|
||||
13
pkgs/cross-compiling/libunwind.patch
Normal file
13
pkgs/cross-compiling/libunwind.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/pkgs/development/compilers/llvm/16/libunwind/default.nix b/pkgs/development/compilers/llvm/16/libunwind/default.nix
|
||||
index 1b677a7a2c0d..6c16e869a085 100644
|
||||
--- a/pkgs/development/compilers/llvm/16/libunwind/default.nix
|
||||
+++ b/pkgs/development/compilers/llvm/16/libunwind/default.nix
|
||||
@@ -49,6 +49,8 @@ stdenv.mkDerivation rec {
|
||||
|
||||
nativeBuildInputs = [ cmake ninja python3 ];
|
||||
|
||||
+ LDFLAGS = "-unwindlib=none";
|
||||
+
|
||||
cmakeFlags = [
|
||||
"-DLLVM_ENABLE_RUNTIMES=libunwind"
|
||||
] ++ lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ callPackage, nixpkgs, tallocStatic }:
|
||||
{ callPackage, tallocStatic }:
|
||||
|
||||
let
|
||||
pkgsCross = import nixpkgs (callPackage ./cross-pkgs-args.nix { });
|
||||
pkgsCross = callPackage ./cross-pkgs.nix { };
|
||||
stdenv = pkgsCross.stdenvAdapters.makeStaticBinaries pkgsCross.stdenv;
|
||||
in
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
# Copyright (c) 2019-2023, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ callPackage
|
||||
, nixpkgs
|
||||
, fetchurl
|
||||
, python3
|
||||
, pkg-config
|
||||
|
|
@ -9,7 +8,7 @@
|
|||
}:
|
||||
|
||||
let
|
||||
pkgsCross = import nixpkgs (callPackage ./cross-pkgs-args.nix { });
|
||||
pkgsCross = callPackage ./cross-pkgs.nix { };
|
||||
in
|
||||
|
||||
pkgsCross.stdenv.mkDerivation rec {
|
||||
|
|
|
|||
|
|
@ -23,14 +23,18 @@ stdenv.mkDerivation {
|
|||
mkdir -p fake-ashmem/linux; cat > fake-ashmem/linux/ashmem.h << EOF
|
||||
#include <linux/limits.h>
|
||||
#include <linux/ioctl.h>
|
||||
#include <string.h>
|
||||
#define __ASHMEMIOC 0x77
|
||||
#define ASHMEM_NAME_LEN 256
|
||||
#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
|
||||
#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t)
|
||||
#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4)
|
||||
EOF
|
||||
substituteInPlace src/arch.h --replace \
|
||||
'#define HAS_LOADER_32BIT true' \
|
||||
""
|
||||
! (grep -F '#define HAS_LOADER_32BIT' src/arch.h)
|
||||
'';
|
||||
|
||||
buildInputs = [ talloc ];
|
||||
patches = [ ./detranslate-empty.patch ];
|
||||
makeFlags = [ "-Csrc" "V=1" ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue