/* Definitions for AMD x86-64 using GNU userspace.
- Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2001-2020 Free Software Foundation, Inc.
Contributed by Jan Hubicka <jh@suse.cz>, based on linux.h.
This file is part of GCC.
done. */
#if TARGET_64BIT_DEFAULT
-#define SPEC_32 "m32"
+#define SPEC_32 "m16|m32"
#if TARGET_BI_ARCH == 2
#define SPEC_64 "m64"
-#define SPEC_X32 "m32|m64:;"
+#define SPEC_X32 "m16|m32|m64:;"
#else
-#define SPEC_64 "m32|mx32:;"
+#define SPEC_64 "m16|m32|mx32:;"
#define SPEC_X32 "mx32"
#endif
#else
#define ASM_SPEC "%{" SPEC_32 ":--32} \
%{" SPEC_64 ":--64} \
%{" SPEC_X32 ":--x32} \
- %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
+ %{msse2avx:%{!mavx:-msse2avx}}"
-#undef LINK_SPEC
-#define LINK_SPEC "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
+#define GNU_USER_TARGET_LINK_SPEC \
+ "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
%{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
%{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
%{shared:-shared} \
%{!shared: \
%{!static: \
- %{rdynamic:-export-dynamic} \
- %{" SPEC_32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "} \
- %{" SPEC_64 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "} \
- %{" SPEC_X32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKERX32 "}} \
- %{static:-static}}"
+ %{!static-pie: \
+ %{rdynamic:-export-dynamic} \
+ %{" SPEC_32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "} \
+ %{" SPEC_64 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "} \
+ %{" SPEC_X32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKERX32 "}}} \
+ %{static:-static} %{static-pie:-static -pie --no-dynamic-linker -z text}}"
+
+#undef LINK_SPEC
+#define LINK_SPEC GNU_USER_TARGET_LINK_SPEC
#if TARGET_64BIT_DEFAULT
#if TARGET_BI_ARCH == 2
#define TARGET_THREAD_SSP_OFFSET \
(TARGET_64BIT ? (TARGET_X32 ? 0x18 : 0x28) : 0x14)
-/* We steal the last transactional memory word. */
-#define TARGET_CAN_SPLIT_STACK
+/* i386 glibc provides __private_ss in %gs:0x30.
+ x32 glibc provides it in %fs:0x40.
+ x86_64 glibc provides it in %fs:0x70. */
#define TARGET_THREAD_SPLIT_STACK_OFFSET \
(TARGET_64BIT ? (TARGET_X32 ? 0x40 : 0x70) : 0x30)
#endif
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE (TARGET_LP64 ? "int" : "long int")