Thanks! I confirm that EMCONFIGURE_JS=0 works as expected now.

The ./configure test basically just does 'fopen ("conftest.val", "w");' and 
then uses fprintf() to output sizeof() for the requested type into 
conftest.val. It gives the wrong value because emcc detects the 'fopen' and 
''w'' and sets use_js = 0 because JS can't write to 
files: 
https://github.com/kripken/emscripten/blob/16d378c78fd9a76f7cf1de856379912e001a1d62/emcc#L211
 
. So, the host compiler is always used for these tests.

./configure scripts also contain another way to determine sizes when cross 
compiling. It performs a binary search using compiler errors in expressions 
of the form 'static int test_array [1 - 2 * !(($2) >= $ac_mid)];'. In other 
words, if (($2) >= $ac_mid), it will try to make an array of size -1, and 
if (($2) < $ac_mid) it will make an array of size 1. The script assumes it 
is not cross compiling when it can run compiled executables, so it uses 
simple method I described in the last paragraph.

On Saturday, 14 February 2015 13:53:00 UTC-5, Alon Zakai wrote:
>
> I fixed the turning off problem, thanks.
>
> Slower is expected. However, wrong type sizes and that error are both 
> surprising. Can you please find out what the configure scripts are doing 
> that fails there (i.e. how emcc is invoked and with what inputs)?
>
> - Alon
>
>
> On Sat, Feb 14, 2015 at 10:07 AM, Boris Gjenero <[email protected] 
> <javascript:>> wrote:
>
>> This works with Em-DOSBox, Bochs 2.6.7 and Synaesthesia. However, it 
>> doesn't seem to be an improvement. Both Bochs (with configure from 
>> http://sourceforge.net/projects/bochs/files/bochs/2.6.7/bochs-2.6.7.tar.gz/download
>>  
>> ) and Em-DOSBox (with configure generated by Autoconf 2.69) still detect 
>> wrong sizes for long and int *. Configure runs a lot slower. Bochs 
>> configure also gives these errors, though they don't actually cause any 
>> problems:
>>
>> checking dynamic linker characteristics... ERROR    root: no input files
>> note that input files without a known suffix are ignored, make sure your 
>> input files end with one of: ('.c', '.C', '.cpp', '.cxx', '.cc', '.c++', 
>> '.CPP', '.CXX', '.CC', '.C++', '.m', '.mm', '.bc', '.o', '.obj', '.dylib', 
>> '.so', '.a', '.ll', '.h', '.hxx', '.hpp', '.hh', '.H', '.HXX', '.HPP', 
>> '.HH') 
>>
>> checking for ld used by 
>> /home/bgjenero/gitapps/emsdk_portable/emscripten/incoming/em++... 
>> /home/bgjenero/gitapps/emsdk_portable/emscripten/incoming/emcc
>> checking if the linker 
>> (/home/bgjenero/gitapps/emsdk_portable/emscripten/incoming/emcc) is GNU 
>> ld... yes
>> ERROR    root: no input files
>> note that input files without a known suffix are ignored, make sure your 
>> input files end with one of: ('.c', '.C', '.cpp', '.cxx', '.cc', '.c++', 
>> '.CPP', '.CXX', '.CC', '.C++', '.m', '.mm', '.bc', '.o', '.obj', '.dylib', 
>> '.so', '.a', '.ll', '.h', '.hxx', '.hpp', '.hh', '.H', '.HXX', '.HPP', 
>> '.HH')
>>
>> Configure leaves a.out and a.out.js files.
>>
>> It seems impossible to turn off this feature via EMCONFIGURE_JS because 
>> os.environ.get() returns a string, which Python treats as True: 
>> https://github.com/kripken/emscripten/commit/9be0275876217eacd30c848b1c7cea68d1a3d986#diff-7d2ad1bd249c50ae58c7226135c3ff33R193
>>
>> On Monday, 9 February 2015 17:08:16 UTC-5, Alon Zakai wrote:
>>>
>>> With one fix, I think I see the test suite passing with EMCONFIGURE_JS 
>>> on.
>>>
>>> Pushed to incoming - please test on your projects that use configure 
>>> scripts!
>>>
>>> - 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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to