Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enabling frame pointers breaks build on MacOS X #6044

Closed
vicuna opened this issue Jun 20, 2013 · 3 comments
Closed

enabling frame pointers breaks build on MacOS X #6044

vicuna opened this issue Jun 20, 2013 · 3 comments
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented Jun 20, 2013

Original bug ID: 6044
Reporter: @avsm
Assigned to: @lefessan
Status: closed (set by @xavierleroy on 2015-12-11T18:19:54Z)
Resolution: fixed
Priority: low
Severity: tweak
Platform: 4.01.0dev
OS: MacOS X
Fixed in version: 4.01.0+dev
Category: ~DO NOT USE (was: OCaml general)

Bug description

Compiling with ./configure -with-frame-pointers breaks the build on MacOS X. It might be less confusing to have the configure script explicitly error out with a "unsupported platform" error for non-x86_64/Linux rather than attempting to continue when frame pointers are requested.

  • ./boot/ocamlrun boot/myocamlbuild byte_stdlib_mixed_mode ocamlc lex/ocamllex ocamlbuild/ocamlbuildlib.cma ocamlbuild/ocamlbuildlightlib.cma ocamlbuild/ocamlbuild.byte ocamlbuild/ocamlbuildlight.byte
  • ./boot/ocamlrun boot/myocamlbuild byte_stdlib_mixed_mode ocamlc lex/ocamllex camlp4/Camlp4/Camlp4Ast.partial.ml camlp4/boot/camlp4boot.byte camlp4/Camlp4.cmo camlp4/Camlp4Top.cmo camlp4/camlp4prof.byte camlp4/mkcamlp4.byte camlp4/camlp4.byte camlp4/camlp4fulllib.cma camlp4/camlp4boot.byte camlp4/camlp4boot.cma camlp4/camlp4r.byte camlp4/camlp4r.cma camlp4/camlp4rf.byte camlp4/camlp4rf.cma camlp4...[truncated]
  • ./boot/ocamlrun boot/myocamlbuild native_stdlib_mixed_mode ocamlopt lex/ocamllex ocamlbuild/ocamlbuildlib.cmxa ocamlbuild/ocamlbuildlightlib.cmxa ocamlbuild/ocamlbuild.native ocamlbuild/ocamlbuildlight.native
    ld: unknown option: -g
    File "ocamlbuild/ocamlbuild_pack.cmx", line 1:
    Error: Error during partial linking
    make[1]: *** [ocamlbuild.native] Error 1

Steps to reproduce

(on MacOS X)
$ opam switch 4.01.0dev+fp

@vicuna
Copy link
Author

vicuna commented Jun 20, 2013

Comment author: @lefessan

I am going to to add this test in ./configure when -with-frame-pointers is enabled:

case "$host,$cc" in
x86_64-,gcc)
nativecccompopts="$nativecccompopts -g -fno-omit-frame-pointer"
bytecccompopts="$bytecccompopts -g -fno-omit-frame-pointer"
nativecclinkopts="$nativecclinkopts -g"
echo "#define WITH_FRAME_POINTERS" >> m.h
;;
*) echo "Unsupported architecture with frame pointers" 1>&2; exit 2;;
esac

Do you think it is enough ? I cannot test on other architectures.

@vicuna
Copy link
Author

vicuna commented Jun 20, 2013

Comment author: @avsm

That diff doesn't fail for me on the Mac. This one does:

diff --git a/configure b/configure
index 4dbf21f..bae0f6e 100755
--- a/configure
+++ b/configure
@@ -1585,12 +1585,12 @@ if test "$with_frame_pointers" = "true"; then
nativecclinkopts="$nativecclinkopts -g"
echo "#define WITH_FRAME_POINTERS" >> m.h

  • case "$cc" in
  • gcc*)
  • case "$cc,$host" in
  • gcc*,x86_64--linux)
    bytecccompopts="$bytecccompopts -fno-omit-frame-pointer"
    nativecccompopts="$nativecccompopts -fno-omit-frame-pointer";;
  • *) echo "Unsupported architecture for -with-frame-pointers" 1>&2; exit 2;;
    esac

fi

@vicuna
Copy link
Author

vicuna commented Jun 20, 2013

Comment author: @lefessan

Should be fixed by commit 13825 in both trunk and version/4.01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants