Hello Source,

Support for cross-compilation is broken by assumptions made in
`make/build_jconsole.sh` and `make/build_libj.sh`. Is there a reasonable fix?
I attach some naïve patches that work for my personal (linux) use case.

I am the maintainer of the J package for Void Linux. The distribution offers
binary package downloads for several target platforms by cross-compiling
packages on a build farm. In order to support their build toolchains, I have to
patch `make/build_{jconsole,libj}.sh`.

In particular, the problem is that the scripts attempt *ad hoc* detection of
gcc via path parsing, and cross-compilation toolchains break those assumptions.
This can be worked around by instead parsing the output of `$CC --version`.
Please see the attached patches against J901-d for a concrete example.

On a larger note, however, the above fix is still a fragile hack. Ideally, we
want to be completely compiler agnostic without directly checking compiler and
version information. The current state of affairs seems to be simply setting
compiler flags (for reasons I do not grok yet); however, perhaps we could move
the necessary flags into equivalent `#pragma` statements or something similar?

I am out of my depth here, so I mostly intend this email as a mean of
instigating discussion.

Cheers,
BW
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to