standard_testfile .c
-set opts [list debug additional_flags=-fshort-enums]
+set opts {}
+lappend opts debug
+lappend opts additional_flags=-fshort-enums
+# Without -nostdlib, on arm we run into:
+#
+# ld: warning: enum_cond.o uses variable-size enums yet the output is to use
+# 32-bit enums; use of enum values across objects may fail
+#
+# due to conflicting values for Tag_ABI_enum_size between enum_cond.o and
+# linked-in objects. Work around this by using -nostdlib, making sure there's
+# just one object, and no such conflict can happen.
+lappend opts additional_flags=-nostdlib
+lappend opts additional_flags=-DHAVE_BUILTIN_TRAP=[have_builtin_trap]
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $opts] != "" } {
untested "failed to compile"
return -1
return $retval
}
+# Return 1 if the compiler supports __builtin_trap, else return 0.
+
+gdb_caching_proc have_builtin_trap {} {
+
+ return [gdb_can_simple_compile builtin_trap {
+ int main() {
+ __builtin_trap ();
+ return 0;
+ }
+ } executable]
+}
+
# Always load compatibility stuff.
load_lib future.exp