ACE_TAO icon indicating copy to clipboard operation
ACE_TAO copied to clipboard

MPC wrongly passes /U file paths to cl

Open alexchandel opened this issue 4 years ago • 6 comments

MPC invokes the compiler as:

$(COMPILE.c) $(CC_OUTPUT_FLAG)$(CC_OUTPUT_FLAG_SEP)$@ $(abspath $<)

When cross-compiling to Windows using LLVM/clang-cl, this causes any source file in a root folder beginning with /U (like /Users/foo/bar.c) to trigger the compiler's /U<A> flag.

This can only be prevented by passing -- before any input files.

MPC needs to define and accept (normally empty) variable, similar to $(CC_OUTPUT_FLAG) and $(CC_OUTPUT_FLAG_SEP), and pass it before any input files.

alexchandel avatar Dec 11 '19 23:12 alexchandel

Is this -type make?

mitza-oci avatar Dec 11 '19 23:12 mitza-oci

-type gnuace

alexchandel avatar Dec 11 '19 23:12 alexchandel

gnuace is maintained in the ACE_TAO repository. Please create an issue there with all the steps necessary to reproduce the problem.

mitza-oci avatar Dec 12 '19 19:12 mitza-oci

@alexchandel if you give us all the steps necessary to reproduce the problem we can look at this

mitza-oci avatar Jan 08 '20 22:01 mitza-oci

This can be replicated by cross-compiling to Windows using LLVM's clang-cl. The replication steps are complex and depend on your environment, but look at the example above/below:

MPC invokes the compiler as $(COMPILE.c) $(CC_OUTPUT_FLAG)$(CC_OUTPUT_FLAG_SEP)$@ $(abspath $<). Source paths that begin with /U, like /Users/foo/bar.c, will be passed to the compiler via $(abspath $<). clang-cl will treat /U as a flag and return an error.

Instead, the compiler should be invoked as:

$(COMPILE.c) $(CC_OUTPUT_FLAG)$(CC_OUTPUT_FLAG_SEP)$@ $(CC_END_OF_OPTIONS) $(abspath $<)

Where CC_END_OF_OPTIONS is defined empty (?=), but can be overridden by the user to --.

alexchandel avatar Feb 03 '23 02:02 alexchandel

OK, please submit a pull request to add support for this compiler to ACE.

mitza-oci avatar Feb 03 '23 02:02 mitza-oci