ACE_TAO icon indicating copy to clipboard operation
ACE_TAO copied to clipboard

Makefiles should invoke $(TAO_IDL_DEP) instead of $(TAO_IDL)

Open alexchandel opened this issue 2 years ago • 3 comments

Version

Latest (7.0.7), also in 6.5.5, probably in all versions.

Host machine and operating system

Linux & macOS

Target machine and operating system (if different from host)

Windows

Compiler name and version (including patch level)

N/A (LLVM)

The $ACE_ROOT/ace/config.h file

N/A (config-win32.h)

The $ACE_ROOT/include/makeinclude/platform_macros.GNU file

platform_win32_msvc.GNU

Contents of $ACE_ROOT/bin/MakeProjectCreator/config/default.features

N/A

AREA/CLASS/EXAMPLE AFFECTED:

All targets that invoke tao_idl (e.g. TAO/tao, TAO/orbsvcs, etc)

The problem effects:

Prevents compiling TAO.

Synopsis

TAO makefiles don't invoke tao_idl correctly.

Description

Many TAO makefiles, like TAO/tao/GNUmakefile.TAO_Core_idl, need to invoke tao_idl. They define a preliminary variable without an exe extension, TAO_IDL, and another, TAO_IDL_DEP, which actually matches the built executable.

However in targets require invoking tao_idl, like GIOPC.cpp, the makefiles instead invoke TAO_IDL. This happens to work on Windows, which will add a .EXE, .BAT, .CMD, .COM, or .CPL for you if you provide no extension and a matching file exists. But it causes cross-compilation from any other platform to fail.

Repeat by

Build the Windows target on a unix system.

Sample fix/ workaround

Please change all invocations of TAO_IDL to TAO_IDL_DEP. This is the single biggest issue I've run into with cross-compiling the Windows MSVC target on a unix host. Other than this (and some platform_macros tweaks, & a -- issue), LLVM does it.

A user can hack around this by defining EXEEXT empty in their platform_macros.GNU, but this breaks the resultant build for Windows and defeats the point.

alexchandel avatar Jun 08 '22 21:06 alexchandel

Please expand the "Repeat by" section to list the specific steps one would do to reproduce the issue. Does it need to run cl.exe in emulation or something similar?

The idea is that TAO_IDL is a command for the host to run whereas TAO_IDL_DEP is a file name that can be used as a dependency in the makefiles.

If you're setting up a new kind of build it's expected that changes to platform_*.GNU would be required (either updating an existing one or making a new one).

mitza-oci avatar Jun 08 '22 22:06 mitza-oci

No emulation. LLVM's compiler can simply be invoked in cl.exe mode, and supports all the args.

The idea is that TAO_IDL is a command for the host to run whereas TAO_IDL_DEP is a file name that can be used as a dependency in the makefiles.

The issue I have is TAO_IDL doesn't equal the filename that the host can run, when cross-compiling to a target that would automatically append file extensions. If you need to keep them separate, maybe you could have TAO_IDL_EXE ?= TAO_IDL or TAO_IDL_EXE ?= TAO_IDL_DEP rule that you invoke, which one can override.

I'm not worried about the platform_*.GNU tweaks, I'll resolve them or open separate issues if needed.

alexchandel avatar Jun 09 '22 01:06 alexchandel

OK, given additional info about your setup I'm sure we can find a configuration that works.

mitza-oci avatar Jun 09 '22 13:06 mitza-oci