I was specifically asking for inability to run compiled tests with EMCONFIGURE_JS=2 so that Autoconf ./configure will assume that it is cross compiling. I'm not sure that this change is supposed to do that. It seems like https://github.com/kripken/emscripten/commit/3702801d1fddc80d2a058507b953ede9dff09b11 simply always compiles to JS even if that would fail to run properly.

The "checking whether we are cross compiling" test must fail to run the compiled binary in order for Autoconf ./configure to assume that it is cross compiling. If that binary runs but later tests fail to run properly, then test results may be bad, for example outputting empty defines like this:
#define SIZEOF_UNSIGNED_CHAR
#define SIZEOF_UNSIGNED_SHORT
#define SIZEOF_UNSIGNED_INT
#define SIZEOF_UNSIGNED_LONG
#define SIZEOF_UNSIGNED_LONG_LONG
#define SIZEOF_INT_P

Surprisingly, I got the results I desire. The cross compiling test binary failed to execute with "./configure: ./conftest: /usr/bin/node: bad interpreter: No such file or directory" because it was looking for /usr/bin/node and there was only /usr/local/bin/node. Then Bochs 2.6.7 proceeded to configure and build without any ./configure hacks being needed. Impressive! However, if I create a /usr/bin/node symlink, I can't make ./configure conclude that it is cross compiling.

I guess tests compiled to JS couldn't be run with EMCONFIGURE_JS=1 either, but most tests were being compiled to native code, so this wasn't causing problems. I see only one Bochs test triggering the error with EMCONFIGURE_JS=1: "checking for ANSI C header files".

BTW. Failure to run compiled C programs can cause an error like this:

checking whether we are cross compiling... configure: error: in `/home/bgjenero/projects/bochs/bochs-2.6.7':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
ERROR root: Configure step failed with non-zero return code 1! Command line: ['./configure', '--without-x', '--with-sdl2', '--disable-show-ips', '--enable-fast-function-calls', '--enable-handlers-chaining'] at /home/bgjenero/projects/bochs/bochs-2.6.7

The solution to that error is simple and self-explanatory. I added --host=le32-unknown-nacl because --host=asmjs-unknown-emscripten isn't recognized.

On 2015-02-23 07:51 PM, Alon Zakai wrote:
Nice idea, added.

- Alon


On Wed, Feb 18, 2015 at 11:42 AM, Boris Gjenero <[email protected]
<mailto:[email protected]>> wrote:

    What about ability to compile all tests to JS without ability to run
    compiled code? Projects which are properly set up with Autoconf in a
    way that enables cross-compiling should configure successfully that
    way. It could be enabled with something like "EMCONFIGURE_JS=2".

    On Tuesday, 17 February 2015 14:59:15 UTC-5, Alon Zakai wrote:

        I see. So if those tests printed instead of writing to a file, I
        guess this would work. Still would be nice to have this work out
        of the box.

        We could try to get fprintf to work in node by writing directly
        to the files synchronously. But we don't currently have support
        for mounting the entire filesystem as NODEFS, it is tricky due
        to devices, see
        https://github.com/kripken/__emscripten/pull/3152
        
<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fkripken%2Femscripten%2Fpull%2F3152&sa=D&sntz=1&usg=AFQjCNFOZkbhLTUYLxBJ2DgWy2fgyYMSXg>
        . However, perhaps we should support an option to mount it,
        ignoring devices, just for this purpose?

        - Alon

    --
    You received this message because you are subscribed to the Google
    Groups "emscripten-discuss" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected]
    <mailto:[email protected]>.
    For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to a topic in the
Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/emscripten-discuss/zLMDkPUmZIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
[email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to