* dietlibc: copy sys/user.h from Glibc, binutils needs it.

* dietlibc: rename the PC macro to __DIETLIBC_PC to prevent name
  clashes.

svn path=/nixpkgs/trunk/; revision=6769
This commit is contained in:
Eelco Dolstra 2006-10-19 10:54:40 +00:00
parent ce22859f8a
commit c696045af0
3 changed files with 87 additions and 1 deletions

View file

@ -12,6 +12,9 @@ postInstall() {
touch empty.c
gcc -c empty.c -o $out/lib/crti.o
gcc -c empty.c -o $out/lib/crtn.o
# Copy <sys/user.h> from Glibc; binutils wants it.
cp $glibc/include/sys/user.h $out/include/sys/
}
genericBuild

View file

@ -9,5 +9,10 @@ stdenv.mkDerivation {
md5 = "2465d652fff6f1fad3da3b98e60e83c9";
};
builder = ./builder.sh;
# patches = [./dietlibc-install.patch];
inherit (stdenv) glibc;
# dietlibc's sigcontext.h provides a macro called PC(), which is
# rather intrusive (e.g., binutils fails to compile because of it).
# Rename it.
patches = [./pc.patch];
}

View file

@ -0,0 +1,78 @@
diff -rc dietlibc-0.30-orig/include/asm/arm-sigcontext.h dietlibc-0.30/include/asm/arm-sigcontext.h
*** dietlibc-0.30-orig/include/asm/arm-sigcontext.h 2002-05-09 03:05:10.000000000 +0200
--- dietlibc-0.30/include/asm/arm-sigcontext.h 2006-10-19 12:40:30.000000000 +0200
***************
*** 1,5 ****
! #define PC(ctx) (ctx.arm_pc)
/*
* Signal context structure - contains all info to do with the state
--- 1,5 ----
! #define __DIETLIBC_PC(ctx) (ctx.arm_pc)
/*
* Signal context structure - contains all info to do with the state
diff -rc dietlibc-0.30-orig/include/asm/i386-sigcontext.h dietlibc-0.30/include/asm/i386-sigcontext.h
*** dietlibc-0.30-orig/include/asm/i386-sigcontext.h 2005-09-21 09:33:08.000000000 +0200
--- dietlibc-0.30/include/asm/i386-sigcontext.h 2006-10-19 12:40:41.000000000 +0200
***************
*** 38,44 ****
};
#define X86_FXSR_MAGIC 0x0000
! #define PC(ctx) (ctx.eip)
struct sigcontext {
__u16 gs, __gsh;
--- 38,44 ----
};
#define X86_FXSR_MAGIC 0x0000
! #define __DIETLIBC_PC(ctx) (ctx.eip)
struct sigcontext {
__u16 gs, __gsh;
diff -rc dietlibc-0.30-orig/include/asm/ia64-sigcontext.h dietlibc-0.30/include/asm/ia64-sigcontext.h
*** dietlibc-0.30-orig/include/asm/ia64-sigcontext.h 2002-07-20 18:47:48.000000000 +0200
--- dietlibc-0.30/include/asm/ia64-sigcontext.h 2006-10-19 12:39:40.000000000 +0200
***************
*** 1,6 ****
#include <sys/ptrace.h>
! #define PC(ctx) (ctx.sc_ip)
struct sigcontext {
unsigned long sc_flags;
--- 1,6 ----
#include <sys/ptrace.h>
! #define __DIETLIBC_PC(ctx) (ctx.sc_ip)
struct sigcontext {
unsigned long sc_flags;
diff -rc dietlibc-0.30-orig/profiling/profil.c dietlibc-0.30/profiling/profil.c
*** dietlibc-0.30-orig/profiling/profil.c 2002-04-08 00:13:53.000000000 +0200
--- dietlibc-0.30/profiling/profil.c 2006-10-19 12:40:58.000000000 +0200
***************
*** 43,51 ****
static void
profiler (int signal, struct sigcontext ctx)
{
! size_t s = PC(ctx)-low_pc;
(void)signal;
! if ((PC(ctx)) < low_pc) return;
s >>= 1;
if (s < maxhits)
++buffer[s];
--- 43,51 ----
static void
profiler (int signal, struct sigcontext ctx)
{
! size_t s = __DIETLIBC_PC(ctx)-low_pc;
(void)signal;
! if ((__DIETLIBC_PC(ctx)) < low_pc) return;
s >>= 1;
if (s < maxhits)
++buffer[s];