Allow parallel build of native and bytecode stubs of the systhreads library.#811
Conversation
|
Can we use the |
|
Alain Frisch (2016/09/14 04:50 -0700):
I don't know yet whether msvc supports it.
Did you read the comment in the commit log? What do you think about it? |
|
Alain Frisch (2016/09/14 04:50 -0700):
Okay so I now know that -o does not work with msvc. As I said in the commit log, I chose the inclusion trick so that it is So all in all, although I don't find the include trick especially |
53abe7b to
da90d0d
Compare
But we are actually calling About allowing potentially different code in bytecode vs native: there are already many differences between the two cases in the existing code, currently managed by conditional compilation as in many other places of the runtime system. The differences are local enough to justify this approach. So I'm not sure this argument can justify the addition of the two source files. |
|
Alain Frisch (2016/09/14 07:30 -0700):
No. What is being used currently is
I just tried, it does not work here. To be more precise, the command used by the Makefile (with this PR cl -nologo -D_CRT_SECURE_NO_DEPRECATE -I../../byterun -O2 -Gy- -MD -Ox -c st_stubs_b.c which works. After having removed the object files, the command: cl -nologo -D_CRT_SECURE_NO_DEPRECATE -I../../byterun -O2 -Gy- -MD -Ox /Fo st_stubs_b.obj -c st_stubs.c produces the following message: cl : Command line warning D9027 : source file 'st_stubs_b.obj' ignored and creates a st_stubs.obj file.
I quickly went through utils/ccomp.ml and couldn't see any option passed I agree the proposed solution is not "clean", but at the same time I'd
Yes, I agree. I mentionned it. So to conclude, I don't think it is possible to specify the output file |
|
Sébastien Hinderer (2016/09/14 17:09 +0200):
So this command works: cl -nologo -D_CRT_SECURE_NO_DEPRECATE -I../../byterun -O2 -Gy- -MD -Ox /Fost_stubs_b.obj -c st_stubs.c |
|
I was about to suggest removing the space after /Fo. So, if this works, do you agree we should simply do this? |
This should have been implemented as part as http://caml.inria.fr/mantis/view.php?id=6475 . Would it make sense to compile with "ocamlc" instead of directly calling the C compiler? (That would avoid having to deal with -o vs /Fo). |
…ibrary. Before this commit, it was not possible to build the object files for st_stubs_b and st_stubs_n in parallel, because both builds were performed by first building an st_stubs object file and then renaming it, resulting in a filename clash in case of parallel build. This commit fixes this situation by giving the C compiler the right options so that object files are created with the right name from the beginning and do not need to be renamed afterwards.
da90d0d to
3bf7ad9
Compare
|
Alain Frisch (2016/09/14 08:45 -0700):
I believe it does not work. I created a toy hello.c and tried this from OCaml's source directory: ./boot/ocamlrun ./ocamlc -verbose -o hello2.o -c hello.c
And with the -c and -o option reversed: ./boot/ocamlrun ./ocamlc -verbose -c hello.c -o hello2.o
Even if it would work, I am not sure. One would have to make sure all The updated version of the PR seems to work. |
|
But aren't the same options passed automatically by "ocamlc -c foo.c" (at least for the bytecode case)? |
|
Alain Frisch (2016/09/14 09:31 -0700):
ocamlc -c passes more options I'd say. Well, given that it currently does not work, I think it's not an option. Moreover, AFAIK, in the OCaml libraries that are included in the |
|
Alain Frisch (2016/09/14 08:40 -0700):
Yes, definitely. It's what is currently implemented. |
…ibrary. (ocaml#811) Before this commit, it was not possible to build the object files for st_stubs_b and st_stubs_n in parallel, because both builds were performed by first building an st_stubs object file and then renaming it, resulting in a filename clash in case of parallel build. This commit fixes this situation by giving the C compiler the right options so that object files are created with the right name from the beginning and do not need to be renamed afterwards.
This PR is a follow-up to #785 and to the discussion with @alainfrisch
that took place there.