With newer versions of emscripten, linker errors surface eariler.
This makes it easier to find function pointer cast errors without
having to execute the bad code path -- the errors happen when the
wasm modules are linked (at load time in the browser)

Anyways, this fixes more linker errors. Mostly the problems have
to do with LAPACK functions that take string arguments. Most
LAPACK functions that take string arguments use them as enums and
only care about the first character of the string. Because of the
way that f2c works, we need to replace these strings with the ascii
code of the first character so we should replace:

sTRSV( 'UPPER', 'NOTRANS', 'NONUNIT', J, H, LDH, Y, 1 )
==>
CALL sTRSV( 85, 78, 78, J, H, LDH, Y, 1 )

where 85 and 78 are the ascii codes of U and N. Various character
variables are subbed into being integer variables. The two
functions `ilaenv` and `xerbla` expect actual C strings as an
argument, but it is very annoying to produce C strings so instead
I added wrapper functions ilaenvf2c and xerblaf2c to clapack and
instead of calling ilaenv and xerbla we call the f2c versions.

Fix scipy linking errors. With newer versions of emscripten, linker errors surface eariler.
This makes it easier to find function pointer cast errors without
having to execute the bad code path -- the errors happen when the
wasm modules are linked (at load time in the browser)

Anyways, this fixes more linker errors. Mostly the problems have
to do with LAPACK functions that take string arguments. Most
LAPACK functions that take string arguments use them as enums and
only care about the first character of the string. Because of the
way that f2c works, we need to replace these strings with the ascii
code of the first character so we should replace:

sTRSV( 'UPPER', 'NOTRANS', 'NONUNIT', J, H, LDH, Y, 1 )
==>
CALL sTRSV( 85, 78, 78, J, H, LDH, Y, 1 )

where 85 and 78 are the ascii codes of U and N. Various character
variables are subbed into being integer variables. The two
functions `ilaenv` and `xerbla` expect actual C strings as an
argument, but it is very annoying to produce C strings so instead
I added wrapper functions ilaenvf2c and xerblaf2c to clapack and
instead of calling ilaenv and xerbla we call the f2c versions.

# HG changeset patch
# User hoodmane
# Date 1627635284 -7200
#      Fri Jul 30 10:54:44 2021 +0200
# Branch patch
# Node ID 8d1dd7efc05383a1ff7430ec3c64154a0ecd4be1
# Parent  e0e3f0fc068ab19d2a8f6daf1f89dea6a7912b8e
Change config settings

diff -r e0e3f0fc068a -r 8d1dd7efc053 c/_cffi_backend.c
--- a/c/_cffi_backend.c	Thu Jul 22 17:44:04 2021 +0200
+++ b/c/_cffi_backend.c	Fri Jul 30 10:54:44 2021 +0200
@@ -107,12 +107,12 @@
 
 #else
 
-# define CFFI_CHECK_FFI_CLOSURE_ALLOC 0
-# define CFFI_CHECK_FFI_CLOSURE_ALLOC_MAYBE 0
-# define CFFI_CHECK_FFI_PREP_CLOSURE_LOC 0
-# define CFFI_CHECK_FFI_PREP_CLOSURE_LOC_MAYBE 0
-# define CFFI_CHECK_FFI_PREP_CIF_VAR 0
-# define CFFI_CHECK_FFI_PREP_CIF_VAR_MAYBE 0
+# define CFFI_CHECK_FFI_CLOSURE_ALLOC 1
+# define CFFI_CHECK_FFI_CLOSURE_ALLOC_MAYBE 1
+# define CFFI_CHECK_FFI_PREP_CLOSURE_LOC 1
+# define CFFI_CHECK_FFI_PREP_CLOSURE_LOC_MAYBE 1
+# define CFFI_CHECK_FFI_PREP_CIF_VAR 1
+# define CFFI_CHECK_FFI_PREP_CIF_VAR_MAYBE 1
 
 #endif
 

# HG changeset patch
# User hoodmane
# Date 1627635284 -7200
#      Fri Jul 30 10:54:44 2021 +0200
# Branch patch
# Node ID 8d1dd7efc05383a1ff7430ec3c64154a0ecd4be1
# Parent  e0e3f0fc068ab19d2a8f6daf1f89dea6a7912b8e
Change config settings

diff -r e0e3f0fc068a -r 8d1dd7efc053 c/_cffi_backend.c
--- a/c/_cffi_backend.c	Thu Jul 22 17:44:04 2021 +0200
+++ b/c/_cffi_backend.c	Fri Jul 30 10:54:44 2021 +0200
@@ -107,12 +107,12 @@
 
 #else
 
-# define CFFI_CHECK_FFI_CLOSURE_ALLOC 0
-# define CFFI_CHECK_FFI_CLOSURE_ALLOC_MAYBE 0
-# define CFFI_CHECK_FFI_PREP_CLOSURE_LOC 0
-# define CFFI_CHECK_FFI_PREP_CLOSURE_LOC_MAYBE 0
-# define CFFI_CHECK_FFI_PREP_CIF_VAR 0
-# define CFFI_CHECK_FFI_PREP_CIF_VAR_MAYBE 0
+# define CFFI_CHECK_FFI_CLOSURE_ALLOC 1
+# define CFFI_CHECK_FFI_CLOSURE_ALLOC_MAYBE 1
+# define CFFI_CHECK_FFI_PREP_CLOSURE_LOC 1
+# define CFFI_CHECK_FFI_PREP_CLOSURE_LOC_MAYBE 1
+# define CFFI_CHECK_FFI_PREP_CIF_VAR 1
+# define CFFI_CHECK_FFI_PREP_CIF_VAR_MAYBE 1
 
 #endif
 
