From d2fabe31a5a2e626194f967ca08d6f18d430b619 Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Thu, 15 Dec 2005 15:11:07 +0000 Subject: [PATCH] Fix to allow udev 076 and udev 077 to compile... add a missing file byteswap.h to klibc-1.1.1 git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@339 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- gen_compile.sh | 12 +++++++++--- pkg/byteswap.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 pkg/byteswap.h diff --git a/gen_compile.sh b/gen_compile.sh index 4e27b77..02c9f64 100644 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -22,9 +22,7 @@ compile_kernel_args() then ARGS="${ARGS} CROSS_COMPILE=\"${KERNEL_CROSS_COMPILE}\"" fi - - ARGS="${ARGS} ARCH=\"${ARCH}\"" - + echo -n "${ARGS}" } @@ -711,6 +709,13 @@ compile_klibc() { [ ! -d "${KLIBC_DIR}" ] && gen_die "klibc tarball ${KLIBC_SRCTAR} is invalid" cd "${KLIBC_DIR}" + if [ -f ${GK_SHARE}/pkg/byteswap.h ] + then + echo "Inserting byteswap.h into klibc" + cp "${GK_SHARE}/pkg/byteswap.h" "include/" + else + echo "${GK_SHARE}/pkg/byteswap.h not found" + fi print_info 1 'klibc: >> Compiling...' ln -snf "${KERNEL_DIR}" linux || gen_die "Could not link to ${KERNEL_DIR}" sed -i MCONFIG -e "s|prefix =.*|prefix = ${TEMP}/klibc-build|g" @@ -732,6 +737,7 @@ compile_klibc() { else compile_generic "" runtask fi + compile_generic "install" runtask } diff --git a/pkg/byteswap.h b/pkg/byteswap.h new file mode 100644 index 0000000..d30b1cb --- /dev/null +++ b/pkg/byteswap.h @@ -0,0 +1,30 @@ +/* + * elf.h + */ + +#ifndef _BYTESWAP_H +#define _BYTESWAP_H + +#define bswap_16(x) \ + ((__u16)( \ + (((__u16)(x) & (__u16)0x00ffU) << 8) | \ + (((__u16)(x) & (__u16)0xff00U) >> 8) )) +#define bswap_32(x) \ + ((__u32)( \ + (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \ + (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \ + (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \ + (((__u32)(x) & (__u32)0xff000000UL) >> 24) )) +#define bswap_64(x) \ + ((__u64)( \ + (__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \ + (__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \ + (__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \ + (__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \ + (__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \ + (__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \ + (__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \ + (__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) )) + +#endif /* _BYTESWAP_H */ + -- 2.26.2