Commit fd89d145 authored by David Mosberger's avatar David Mosberger

ia64: Check for acceptable version of gas before trying to build

	the kernel.  Old gas versions will result in buggy kernels
	that will bugcheck all over the place (usually mount() is
	the first one to fail).
parent a79b0f25
......@@ -23,6 +23,16 @@ CFLAGS_KERNEL := -mconstant-gp
GCC_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.')
GAS_STATUS=$(shell arch/ia64/scripts/check-gas $(CC))
ifeq ($(GAS_STATUS),buggy)
$(error Sorry, you need a newer version of the assember, one that is built from \
a source-tree that post-dates 18-Dec-2002. You can find a pre-compiled \
static binary of such an assembler at: \
\
ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz)
endif
ifneq ($(GCC_VERSION),2)
cflags-y += -frename-registers --param max-inline-insns=5000
endif
......
......@@ -44,7 +44,6 @@ extern void put_dirty_page (struct task_struct * tsk, struct page *page, unsigne
static void elf32_set_personality (void);
#define ELF_PLAT_INIT(_r) ia64_elf32_init(_r)
#define setup_arg_pages(bprm) ia32_setup_arg_pages(bprm)
#define elf_map elf32_map
......
......@@ -142,7 +142,7 @@ ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
switch (break_num) {
case 0: /* unknown error (used by GCC for __builtin_abort()) */
die_if_kernel("bad break", regs, break_num);
die_if_kernel("bugcheck!", regs, break_num);
sig = SIGILL; code = ILL_ILLOPC;
break;
......
#!/bin/sh
dir=$(dirname $0)
CC=$1
$CC -c $dir/check-gas-asm.S
res=$(objdump -r --section .data check-gas-asm.o | fgrep 00004 | tr -s ' ' |cut -f3 -d' ')
if [ $res != ".text" ]; then
echo buggy
else
echo good
fi
exit 0
[1:] nop 0
.xdata4 ".data", 0, 1b-.
......@@ -128,38 +128,28 @@ struct __large_struct { unsigned long buf[100]; };
/* We need to declare the __ex_table section before we can use it in .xdata. */
asm (".section \"__ex_table\", \"a\"\n\t.previous");
#if __GNUC__ >= 3
# define GAS_HAS_LOCAL_TAGS /* define if gas supports local tags a la [1:] */
#endif
#ifdef GAS_HAS_LOCAL_TAGS
# define _LL "[1:]"
#else
# define _LL "1:"
#endif
#define __get_user_64(addr) \
asm ("\n"_LL"\tld8 %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \
"\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \
_LL \
asm ("\n[1:]\tld8 %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \
"\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \
"[1:]" \
: "=r"(__gu_val), "=r"(__gu_err) : "m"(__m(addr)), "1"(__gu_err));
#define __get_user_32(addr) \
asm ("\n"_LL"\tld4 %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \
"\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \
_LL \
asm ("\n[1:]\tld4 %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \
"\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \
"[1:]" \
: "=r"(__gu_val), "=r"(__gu_err) : "m"(__m(addr)), "1"(__gu_err));
#define __get_user_16(addr) \
asm ("\n"_LL"\tld2 %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \
"\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \
_LL \
asm ("\n[1:]\tld2 %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \
"\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \
"[1:]" \
: "=r"(__gu_val), "=r"(__gu_err) : "m"(__m(addr)), "1"(__gu_err));
#define __get_user_8(addr) \
asm ("\n"_LL"\tld1 %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \
"\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \
_LL \
asm ("\n[1:]\tld1 %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \
"\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \
"[1:]" \
: "=r"(__gu_val), "=r"(__gu_err) : "m"(__m(addr)), "1"(__gu_err));
extern void __put_user_unknown (void);
......@@ -201,30 +191,30 @@ extern void __put_user_unknown (void);
*/
#define __put_user_64(x,addr) \
asm volatile ( \
"\n"_LL"\tst8 %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \
"\n[1:]\tst8 %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \
"\t.xdata4 \"__ex_table\", 1b-., 1f-.\n" \
_LL \
"[1:]" \
: "=r"(__pu_err) : "m"(__m(addr)), "rO"(x), "0"(__pu_err))
#define __put_user_32(x,addr) \
asm volatile ( \
"\n"_LL"\tst4 %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \
"\n[1:]\tst4 %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \
"\t.xdata4 \"__ex_table\", 1b-., 1f-.\n" \
_LL \
"[1:]" \
: "=r"(__pu_err) : "m"(__m(addr)), "rO"(x), "0"(__pu_err))
#define __put_user_16(x,addr) \
asm volatile ( \
"\n"_LL"\tst2 %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \
"\n[1:]\tst2 %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \
"\t.xdata4 \"__ex_table\", 1b-., 1f-.\n" \
_LL \
"[1:]" \
: "=r"(__pu_err) : "m"(__m(addr)), "rO"(x), "0"(__pu_err))
#define __put_user_8(x,addr) \
asm volatile ( \
"\n"_LL"\tst1 %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \
"\n[1:]\tst1 %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \
"\t.xdata4 \"__ex_table\", 1b-., 1f-.\n" \
_LL \
"[1:]" \
: "=r"(__pu_err) : "m"(__m(addr)), "rO"(x), "0"(__pu_err))
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment