porffor 0.57.22 → 0.57.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler/index.js +6 -1
- package/package.json +1 -1
- package/runtime/index.js +1 -1
package/compiler/index.js
CHANGED
@@ -227,6 +227,8 @@ export default (code, module = undefined) => {
|
|
227
227
|
}
|
228
228
|
|
229
229
|
if (target === 'c') {
|
230
|
+
if (Prefs.wasm) fs.writeFileSync(Prefs.wasm, Buffer.from(wasm));
|
231
|
+
|
230
232
|
const c = toc(out);
|
231
233
|
out.c = c;
|
232
234
|
|
@@ -248,12 +250,15 @@ export default (code, module = undefined) => {
|
|
248
250
|
if (target === 'native') {
|
249
251
|
outFile ??= Prefs.native ? './porffor_tmp' : file.split('/').at(-1).split('.')[0];
|
250
252
|
|
251
|
-
const compiler = (Prefs.compiler ?? '
|
253
|
+
const compiler = (Prefs.compiler ?? process.env.CC ?? 'cc').split(' ');
|
252
254
|
const cO = Prefs._cO ?? 'O3';
|
253
255
|
|
254
256
|
const tmpfile = 'porffor_tmp.c';
|
255
257
|
const args = [ ...compiler, tmpfile, '-o', outFile ?? (process.platform === 'win32' ? 'out.exe' : 'out'), '-' + cO ];
|
258
|
+
|
259
|
+
// todo: redo how default cc args work
|
256
260
|
if (compiler.includes('clang')) args.push('-lm', '-flto=thin', '-march=native', '-ffast-math', '-fno-exceptions', '-fno-ident', '-fno-asynchronous-unwind-tables', '-ffunction-sections', '-fdata-sections');
|
261
|
+
|
257
262
|
if (Prefs.s) args.push('-s');
|
258
263
|
|
259
264
|
if (logProgress) progressStart('compiling Wasm to C...');
|
package/package.json
CHANGED