[Issue 24293] ImportC: parallel compilation failure

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 24 14:09:49 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=24293

--- Comment #2 from kdevel <kdevel at vogtner.de> ---
(In reply to Walter Bright from comment #1)
> Try it serially.

I did so before and it worked (surprisingly!). But when it came to make -j4 the
non-reentrancy of dmd showed up. The cause of the problem is, that for every
import statement dmd invokes cpp to generate for each header file $h.h a
preprocessed $h.i (pure C file).

This can be prevented by creating the .i file with

cpp -m64 -dD -Wno-builtin-macro-redefined cmysql.c -include
[...]dmd2/linux/bin64/../../src/druntime/import/importc.h cmysql.i

once and before starting the compilation of the dependent D source files.

I would appreciate if dmd had a switch to generate the .i from the .c. A short
note in the docs would be nice, too.

--


More information about the Digitalmars-d-bugs mailing list