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

In function camlCtIdent__126': undefined reference to .L100123' when compiling camltemplate 1.0.1 examples: undefined refe #3979

Closed
vicuna opened this issue Feb 19, 2006 · 2 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Feb 19, 2006

Original bug ID: 3979
Reporter: jjhellst
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2006-03-23T15:24:14Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.09.1
Category: back end (clambda to assembly)
Monitored by: jjhellst @mmottl

Bug description

CamlTemplate library fails to compile properly using ocaml 3.09.1 version. I tried to isolate this issue into a smaller test case, but it turned out to be more difficult than I thought. In order to reproduce, you need to download camltemplate 1.01 from http://saucecode.org/camltemplate/releases/.

Originally reportd by Owen Gunden:

8<
Does camltemplate work with 3.09.1? I get a whole bunch of undefined reference
errors when I try to build the 'hello' example with native code:

/tmp/camltemplate-1.0.1/examples/hello$ make native-code
ake[1]: Entering directory /tmp/camltemplate-1.0.1/examples/hello' make[1]: hello' is up to date.
make[1]: Leaving directory /tmp/camltemplate-1.0.1/examples/hello' make[1]: Entering directory /tmp/camltemplate-1.0.1/examples/hello'
ocamlopt -c -I /usr/local/home/godi/godi/lib/ocaml/pkg-lib/pcre -I ../../src hello.ml
ocamlopt

-I /usr/local/home/godi/godi/lib/ocaml/pkg-lib/pcre -I ../../src unix.cmxa pcre.cmxa camltemplate.cmxa -o hello
hello.cmx
../../src/camltemplate.a(ctIdent.o)(.data+0x1c): In function camlCtIdent__126': : undefined reference to .L100123'
../../src/camltemplate.a(ctIdent.o)(.data+0x20): In function camlCtIdent__126': : undefined reference to .L100124'
[... many more similar errors ...]
8<

This can be reproduced by first compiling CamlTemplate with "cd camltemplate-1.01 && ./configure && make opt" and "cd examples && cd hello && make native-code".

Inspecting the issue, I looked at one of the .s files produced from the compilation of camltemplate, and it looks like the .s files is referring to some symbols that are indeed missing.

For example, if you take a look at this produced x86 disassembly:

camlCtIdent__127:
.long camlCtIdent__ident_init_138
.long 3
.data
.long 13312
camlCtIdent__126:
.long .L100123
.long .L100124
.long .L100135
.long .L100117
...

camlCtIdent__126 is referring to symbol .L100123 which is nowhere to
be found (see the attached ctIdent.s). It looks to me that ocamlopt
is somehow failing to produce those .Lxyz labels.

Best regards,
Janne

File attachments

@vicuna
Copy link
Author

vicuna commented Feb 19, 2006

Comment author: jjhellst

Sorry about the messed up subject, copy&pasting multiple lines into the editbox turned out to be difficult. :(

@vicuna
Copy link
Author

vicuna commented Mar 23, 2006

Comment author: @xavierleroy

Incorrect sharing of string literals between several compilation units
compiled with the same invocation of ocamlopt. Fixed in 3.09 branch,
will be OK in 3.09.2

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

No branches or pull requests

2 participants