Skip to content

4.01.0dev emits compact unwind warnings since switch to clang #5921

@vicuna

Description

@vicuna

Original bug ID: 5921
Reporter: @avsm
Assigned to: @mshinwell
Status: closed (set by @xavierleroy on 2015-12-11T18:29:29Z)
Resolution: fixed
Priority: normal
Severity: minor
OS: MacOS X
OS Version: 10.8
Version: 4.00.1
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.01.0
Category: ~DO NOT USE (was: OCaml general)
Tags: patch
Monitored by: meurer @ygrek @dbuenzli

Bug description

On latest MacOS X and trunk, any invocation of the linker results in warnings such as:

ld: warning: could not create compact unwind for _camlTypecore__add_pattern_variables_1925: stack subq instruction is too different from dwarf stack size
ld: warning: could not create compact unwind for _camlTypecore__type_pattern_1937: stack subq instruction is too different from dwarf stack size
ld: warning: could not create compact unwind for _camlTypecore__type_pattern_list_1949: stack subq instruction is too different from dwarf stack size
ld: warning: could not create compact unwind for _camlTypecore__type_class_arg_pattern_1959: stack subq instruction is too different from dwarf stack size
ld: warning: could not create compact unwind for _camlTypecore__mkpat_1981: stack subq instruction is too different from dwarf stack size

The warnings can be suppressed by passing -no-compact-unwind to the linker:

--- a/configure
+++ b/configure
@@ -734,7 +734,8 @@ case "$arch,$nativecc,$system,$host_type" in
,,rhapsody,) nativecccompopts="$gcc_warnings -DDARWIN_VERSION_6 $dl_defs"
if $arch64; then partialld="ld -r -arch ppc64"; fi;;
,gcc,cygwin,
) nativecccompopts="$gcc_warnings -U_WIN32";;

  • amd64,gcc*,macosx,*) partialld="ld -r -arch x86_64";;
  • amd64,gcc*,macosx,*) partialld="ld -r -arch x86_64"
  •                   nativecccompopts="-Wl,-no_compact_unwind";;
    
    amd64,gcc*,solaris,) partialld="ld -r -m elf_x86_64";;
    ,gcc,
    ,*) nativecccompopts="$gcc_warnings";;
    esac

but I've not got an older 10.6/7 to see if this breaks anything there. Although I notice that trunk is also broken on 10.6 due to #5912

The above patch also still results in relocation warnings while bootstrapping the compiler.

Steps to reproduce

$ echo 'let _ = Printf.printf "foo%!"' > test.ml
$ ocamlopt -linkall test.ml
<warnings result on MacOS X 10.8>

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions