Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005921OCamlOCaml generalpublic2013-02-13 18:032014-06-18 09:19
Reporteravsm 
Assigned Toshinwell 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionopen 
PlatformOSMacOS XOS Version10.8
Product Version4.00.1 
Target Version4.02.0+devFixed in Version 
Summary0005921: 4.01.0dev emits compact unwind warnings since switch to clang
DescriptionOn 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 http://caml.inria.fr/mantis/view.php?id=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>
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0008929)
doligez (administrator)
2013-02-26 13:43

Reproduced on 10.7.5 with Xcode 4.5.1.
Your patch doesn't work (at least on my machine) because this part of the configuration script is totally messed up: the nativecccompopts variable is not used to link native executables.

We will need to clean up the configuration script and the "driver" part of the compilers.
(0009002)
doligez (administrator)
2013-03-22 18:59

In fact, $nativecccompopts is not used for linking executables. Nor is $nativecclinkopts (this is used only with ld for packing libraries). The flag must be put into both $mksharedlib and $mkexe.

I've done that and the warning disappeared (commit 13423 in trunk). Not tested on earlier versions of XCode. If they break and someone cares, we'll probably have to test for the presence of "clang" in the path before we add this flag.
(0010635)
johnwhitington (reporter)
2013-11-14 12:25

This warning is now gone with 4.01.0 on Xcode 5 / OS X 10.9, without any patch.

However, we now have another rather abundant noisy warning:

ocamlfind ocamlc cpdflibwrapper.c;
clang: warning: argument unused during compilation: '-fno-defer-pop'
(0011742)
shinwell (developer)
2014-06-11 17:41

I think just silencing these warnings may have been a mistake; it might indicate an error in the DWARF information emitted by the OCaml compiler. I am going to investigate further later this week, since there has been recent evidence of problems in this area.

- Issue History
Date Modified Username Field Change
2013-02-13 18:03 avsm New Issue
2013-02-26 13:43 doligez Note Added: 0008929
2013-02-26 13:43 doligez Status new => confirmed
2013-03-22 18:59 doligez Note Added: 0009002
2013-03-22 18:59 doligez Status confirmed => resolved
2013-03-22 18:59 doligez Resolution open => fixed
2013-11-14 12:25 johnwhitington Note Added: 0010635
2014-06-11 17:41 shinwell Note Added: 0011742
2014-06-11 17:41 shinwell Assigned To => shinwell
2014-06-11 17:41 shinwell Status resolved => assigned
2014-06-11 17:42 shinwell Resolution fixed => open
2014-06-11 17:42 shinwell Target Version => 4.02.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker