Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005643OCamlOCaml internal build/install (Makefiles, configure)public2012-06-09 11:282012-06-17 10:19
Reportermww 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformDarwin/IntelOSMac OS XOS Version10.6.4
Product Version3.12.1 
Target VersionFixed in Version4.00.0+dev 
Summary0005643: 4.00.0+beta2 fails to compile with llvm/clang 3.1 on OS X
DescriptionThe 4.00.0+beta2 fails to compile with clang/llvm from XCode 4.3.2:

When building with the default compiler (clang) on OS X 10.7 with XCode 4.3.2, the build of ocaml fails.
Steps To Reproduce./configure -no-tk -cc cc -aspp 'cc -c'
make world.opt

OR more explicitely:

./configure -no-tk -cc /usr/bin/clang -aspp '/usr/bin/clang -c'
make world.opt
Additional Information'cc' points to '/usr/bin/clang' by default with the Apple developer tools on this platform/version;

a build log of the failed compilation can be found here:
http://build.macports.org/builders/buildports-lion-x86_64/builds/1562/steps/compile/logs/stdio [^]

The error looks as follows:

../boot/ocamlrun ../ocamlopt -warn-error A -nostdlib -g `./Compflags pervasives.cmx` -c pervasives.ml
/tmp/camlasm1f3d36.s:636:Unknown pseudo-op: .cfi_startproc
/tmp/camlasm1f3d36.s:678:Unknown pseudo-op: .cfi_endproc
/tmp/camlasm1f3d36.s:684:Unknown pseudo-op: .cfi_startproc
/tmp/camlasm1f3d36.s:686:Unknown pseudo-op: .cfi_adjust_cfa_offset
/tmp/camlasm1f3d36.s:686:Rest of line ignored. 1st junk character valued 56 (8).
TagsNo tags attached.
Attached Filestxt file icon configure-verbose.txt [^] (29,062 bytes) 2012-06-12 09:47 [Show Content]
txt file icon build-log.txt [^] (123,004 bytes) 2012-06-13 08:51 [Show Content]
txt file icon configure-log.txt [^] (29,058 bytes) 2012-06-13 08:51 [Show Content]
diff file icon loc-line-numbers.diff [^] (979 bytes) 2012-06-13 09:31 [Show Content]
diff file icon debuginfo-is-none.diff [^] (2,840 bytes) 2012-06-13 11:09 [Show Content]
diff file icon configure-cfi-detect.diff [^] (786 bytes) 2012-06-13 11:30 [Show Content]

- Relationships

-  Notes
(0007531)
protz (manager)
2012-06-09 11:41

Does it help if you edit config/Makefile *after* the configure step and set ASM_CFI_SUPPORTED to false?
(0007532)
mww (reporter)
2012-06-09 12:19

yes, that fixes it!
(0007537)
ygrek (reporter)
2012-06-11 08:38

Please, can you run configure with -verbose option?
(0007538)
mww (reporter)
2012-06-12 09:49

log of
$> ./configure -no-tk -cc /usr/bin/clang -aspp '/usr/bin/clang -c' -verbose
is attached as configure-verbose.txt
(0007539)
ygrek (reporter)
2012-06-12 13:59

As far as I understand clang supports CFI and it was correctly detected. But looks like ocamlopt is not calling clang, can you run the failing command with -verbose switch? i.e. :

../boot/ocamlrun ../ocamlopt -verbose -warn-error A -nostdlib -g `./Compflags pervasives.cmx` -c pervasives.ml
(0007540)
ygrek (reporter)
2012-06-12 14:02

Ah, indeed, configure sets assembler to 'as'. Try

./configure -cc cc -aspp 'cc -c' -as 'cc -c'
(0007548)
mww (reporter)
2012-06-13 08:50

With
$> /configure -cc /usr/bin/clang -aspp '/usr/bin/clang -c' -as '/usr/bin/clang -c' -no-tk -verbose
the build fails with

...
../boot/ocamlrun ../ocamlopt -warn-error A -nostdlib -g `./Compflags printexc.cmx` -c printexc.ml
/var/folders/9s/m9j8wht52_sgdk9f9mrk7j5r0000gn/T/camlasm1a3812.s:826:9: error: line number less than one in '.loc' directive
 .loc 2 0
        ^
/var/folders/9s/m9j8wht52_sgdk9f9mrk7j5r0000gn/T/camlasm1a3812.s:870:9: error: line number less than one in '.loc' directive
 .loc 2 0
        ^
(0007549)
mww (reporter)
2012-06-13 08:52

The full log of configure and build with
$> /configure -cc /usr/bin/clang -aspp '/usr/bin/clang -c' -as '/usr/bin/clang -c' -no-tk -verbose
are in the attached files configure-log.txt and build-log.txt.
(0007550)
ygrek (reporter)
2012-06-13 09:31

Obvious fix attached, please test
(0007551)
mww (reporter)
2012-06-13 09:43

compiles with 'loc-line-numbers.diff'
(0007552)
ygrek (reporter)
2012-06-13 11:10

Please disregard loc-line-numbers.diff as it hides the real problem.
Zero line numbers were emitted because physical comparison was used to detect dummy debuginfo. But Debuginfo.t values are stored in cmx files and after unmarshalling Debuginfo.is_none fails to detect all dummy values. Attached is a patch to use structural comparison for Debuginfo.t (debuginfo-is-none.diff)
(0007553)
ygrek (reporter)
2012-06-13 11:31

Prevent the original problem by checking that both $as and $aspp understand CFI directives (configure-cfi-detect.diff)
(0007562)
xleroy (administrator)
2012-06-17 10:19

Applied the last two patches (debuginfo-is-none and configure-cfi-detect) in 4.00 branch (r12610) and in trunk (r12611).

- Issue History
Date Modified Username Field Change
2012-06-09 11:28 mww New Issue
2012-06-09 11:41 protz Note Added: 0007531
2012-06-09 12:19 mww Note Added: 0007532
2012-06-11 08:38 ygrek Note Added: 0007537
2012-06-12 09:47 mww File Added: configure-verbose.txt
2012-06-12 09:49 mww Note Added: 0007538
2012-06-12 13:59 ygrek Note Added: 0007539
2012-06-12 14:02 ygrek Note Added: 0007540
2012-06-13 08:50 mww Note Added: 0007548
2012-06-13 08:51 mww File Added: build-log.txt
2012-06-13 08:51 mww File Added: configure-log.txt
2012-06-13 08:52 mww Note Added: 0007549
2012-06-13 09:31 ygrek File Added: loc-line-numbers.diff
2012-06-13 09:31 ygrek Note Added: 0007550
2012-06-13 09:43 mww Note Added: 0007551
2012-06-13 11:09 ygrek File Added: debuginfo-is-none.diff
2012-06-13 11:10 ygrek Note Added: 0007552
2012-06-13 11:30 ygrek File Added: configure-cfi-detect.diff
2012-06-13 11:31 ygrek Note Added: 0007553
2012-06-17 10:19 xleroy Note Added: 0007562
2012-06-17 10:19 xleroy Status new => resolved
2012-06-17 10:19 xleroy Resolution open => fixed
2012-06-17 10:19 xleroy Fixed in Version => 4.00.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker