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

Identifier too long for MASM in a generated assembly file #7895

Closed
vicuna opened this issue Jan 16, 2019 · 3 comments
Closed

Identifier too long for MASM in a generated assembly file #7895

vicuna opened this issue Jan 16, 2019 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Jan 16, 2019

Original bug ID: 7895
Reporter: @db4
Status: acknowledged (set by @nojb on 2019-01-17T13:03:56Z)
Resolution: open
Priority: normal
Severity: major
Platform: Windows
OS: 10
Version: 4.06.1
Category: platform support (windows, cross-compilation, etc)
Monitored by: @nojb

Bug description

I'm trying to setup MSVC-compiled OCaml toolchain via OPAM 2.0. In my case it means that the compiler is built from sources in "C:\Users\dbely.opam\4.06.1+vc15+x86.opam-switch\build\ocaml-variants.4.06.1+win32" folder. During opt build "utils/strongly_connected_components.ml" is compiled and the following line is generated for MASM:

mov	eax, OFFSET _camlStrongly_connected_components__anon$2dfn$5bC$3a$5cUsers$5cdbely$5c$2eopam$5c4$2e06$2e1$2bvc15$2bx86$5c$2eopam$2dswitch$5cbuild$5cocaml$2dvariants$2e4$2e06$2e1$2bwin32$5cutils$5cstrongly_connected_components$2eml$3a155$2c26$2d$2d29$5d_388_closure

camlStrongly... identifier is 251 character long. It is too much for MASM (the limit is 247 chars) and it reports

camlasm00e3f6.asm(919) : error A2043:identifier too long

Maybe knowing that limitation OCaml compiler should not include the full source path into identifier names? For instance, maybe use md5 digests instead?

@vicuna
Copy link
Author

vicuna commented Jan 16, 2019

Comment author: @nojb

This seems an issue with FLAMBDA which includes the location information in some generated symbol names: see

https://github.com/ocaml/ocaml/blob/trunk/middle_end/internal_variable_names.ml#L293-L301

@vicuna
Copy link
Author

vicuna commented Jan 17, 2019

Comment author: @db4

Yes, you are right, thanks a lot for the hint. Switching FLAMBDA off solves the issue. So this is less important than I initially thought.

@mshinwell
Copy link
Contributor

#8507 will be merged very soon, and will fix this.

@vicuna vicuna added the bug label Mar 20, 2019
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

3 participants