summaryrefslogtreecommitdiff
blob: ffd9f4351d1f16489f0f0c245fa229acf02f2f7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
diff --git a/sys/boot/i386/Makefile.inc b/sys/boot/i386/Makefile.inc
index f5faec7..a9cf593 100644
--- a/sys/boot/i386/Makefile.inc
+++ b/sys/boot/i386/Makefile.inc
@@ -12,7 +12,6 @@ LDFLAGS+=	-nostdlib
 .if ${MACHINE_CPUARCH} == "amd64"
 CFLAGS+=	-m32
 ACFLAGS+=	-m32
-LDFLAGS+=	-m elf_i386_fbsd
 AFLAGS+=	--32
 .endif
 
diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile
index 65815a5..61840dd 100644
--- a/sys/boot/i386/boot2/Makefile
+++ b/sys/boot/i386/boot2/Makefile
@@ -109,3 +109,10 @@ machine:
 # XXX: clang integrated-as doesn't grok .codeNN directives yet
 CFLAGS.boot1.S=		${CLANG_NO_IAS}
 CFLAGS+=		${CFLAGS.${.IMPSRC:T}}
+
+# gcc 4.6 or later version, -fno-asynchronous-unwind-tables is required to build.
+CFLAGS+=		-fno-asynchronous-unwind-tables
+
+.if ${MACHINE_CPUARCH} == "amd64"
+LDFLAGS+=		-m elf_i386_fbsd
+.endif
diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile
index e1a640a..29886cc 100644
--- a/sys/boot/i386/gptboot/Makefile
+++ b/sys/boot/i386/gptboot/Makefile
@@ -78,3 +78,8 @@ machine:
 # XXX: clang integrated-as doesn't grok .codeNN directives yet
 CFLAGS.gptldr.S=	${CLANG_NO_IAS}
 CFLAGS+=		${CFLAGS.${.IMPSRC:T}}
+
+.if ${MACHINE_CPUARCH} == "amd64"
+LDFLAGS+=		-m elf_i386_fbsd
+.endif
+
diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile
index a2b8fcc..107f531 100644
--- a/sys/boot/i386/gptzfsboot/Makefile
+++ b/sys/boot/i386/gptzfsboot/Makefile
@@ -76,3 +76,8 @@ machine:
 # XXX: clang integrated-as doesn't grok .codeNN directives yet
 CFLAGS.gptldr.S=	${CLANG_NO_IAS}
 CFLAGS+=		${CFLAGS.${.IMPSRC:T}}
+
+.if ${MACHINE_CPUARCH} == "amd64"
+LDFLAGS+=		-m elf_i386_fbsd
+.endif
+
diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile
index b2db778..252dc62 100644
--- a/sys/boot/i386/zfsboot/Makefile
+++ b/sys/boot/i386/zfsboot/Makefile
@@ -89,3 +89,8 @@ machine:
 # XXX: clang integrated-as doesn't grok .codeNN directives yet
 CFLAGS.zfsldr.S=	${CLANG_NO_IAS}
 CFLAGS+=		${CFLAGS.${.IMPSRC:T}}
+
+.if ${MACHINE_CPUARCH} == "amd64"
+LDFLAGS+=		-m elf_i386_fbsd
+.endif
+