Repository navigation
Add align_double and align_int64 to ocamlc -config - #12019
Conversation
c653697 to
7b388b2
Compare
Just to confirm, this is only an issue in 32-bits, do you agree? In 64-bits everything is 64-bit aligned anyway, right? |
Maybe? Looks like the |
|
Overall the code looks okay to me.
I have one remark and one question.
Question: can you confirm that the values in `utils/config.fixed.ml`
really are what you defined, i.e. true?
Remark: in the documentation strings in `utils/config.mli`, there are
two occurrences of `Wether the compiler and runtime needs to ...` where
`needs` should be `need`.
|
Agreed. But they are already readily accessible from C code: just include |
Otherwise, one has to write a test C program that does the include/printf dance and execute it to get its result. Also, I was pretty surprised to see an unscoped global macro named like that. |
Thanks! It's carnival time here in New Orleans but I plan on addressing these comments as soon as reality is back to normal! 🎭 |
Point well taken. I'm still curious why you need to know the alignment constraints of the target machine to conditionally select things at build system level. My experience so far is that you need to
First, you're changing the topic. Second, I don't agree with your other suggestion. Like most C libraries, OCaml tries to make function names and global variable names unique by prefixing them with But like most C libraries, OCaml doesn't need to make and macro names unique, because they are visible only if you For example, |
7b388b2 to
a6355fa
Compare
Good call, thanks.
Fixed too, thanks for pointing out! |
Fair enough! As a developer I don't really feel confortable using a macro with a generic name but, as you pointed out, this is done some other places. If I have this value explicitly available through |
|
Thanks a lot. I am notsure that the PR itself does need to update
`boot/ocamlc\`? Can we perhaps wait the next bootstrap, or do we have to
have correct values immediately?
Actually my question was unclear, sorry about that. What I was asking
was whether the values for hte fixed configuration were really intended
to be true, I wanted to make sure you had asked yourself about that. I
was not trying to ensure that you deed a bootstrap to update the boot
compiler and I don't actually knowwhether this really needs to happen in
this PR.
|
Ha I see. I'm not sure what the values should be in fact, the doc says:
In this case, the values could be |
|
Perhaps it's best to listen to @dra27 on this?
|
dra27
left a comment
There was a problem hiding this comment.
LGTM, apart from a couple of tweaks to the .mli file. The update to config.fixed.ml is indeed correct - the alignment requirements won't affect any of the outputs of the compiler, and therefore you just pick a value in the bootstrap.
Done, thanks! |
5fa51e5 to
cb37932
Compare
|
Looks like I totally forgot to merge this. Just fixed the conflicts. Planning on merging unless someone is opposed to it. |
|
There is a change to boot/ocamlc in your PR, you need to redo this step now to not put back an older compiler version. Did you already redo the bootstrap? |
Yes I did! |
|
Bootstrap doesn't appear to be correct (just noting not to merge yet) |
12ddfed to
8e81698
Compare
|
Rebased to clean out the edits in merge commits - this shouldn't require a bootstrap. Should be good to go now, thanks! |
|
Thanks so much for the help! |
|
It seems that the lack of handling for 32bit architecture is making the compiler fails due to a syntax error on 32 bits architecture. |
|
Is there a pointer to where the problem is, @Octachron? Apart from the fact the i386 test here was fine, I'm struggling to see by inspection how any path could lead to a syntax error here? |
|
Sorry, this is indeed ARM32 specific, for which the generated let align_double = true,
let align_int64 = true, |
|
Working on a fix. See my branch fix-12019 on shindere/ocaml. It's
currently going through prechecki:
https://ci.inria.fr/ocaml/job/precheck/984
|
|
Thanks! @mtelvers had spotted it on our arm32 builds as well and we were about to open a PR with the same fix! |
These two values, particularly the
doubleone, can be very useful to make low-level optimization of C code handling e.g.floatarray.