0
0
mirror of https://github.com/cjdelisle/cjdns synced 2025-10-06 00:32:50 +02:00

march=native defaults to false

This commit is contained in:
Caleb James DeLisle
2025-01-08 09:39:03 +00:00
parent 4be793cb0b
commit 8f67a529c2

View File

@@ -23,10 +23,6 @@ const GetVersion = require('./GetVersion');
var CFLAGS = process.env['CFLAGS']; var CFLAGS = process.env['CFLAGS'];
var LDFLAGS = process.env['LDFLAGS']; var LDFLAGS = process.env['LDFLAGS'];
// march=native really only makes a lot of sense on x86/amd64 where the available features
// are a hodgepodge per-CPU. On arm (32) you may or may not have NEON available but in any
// case clang doesn't reliably support march except on x86/amd64.
var NO_MARCH_FLAG = ['arm', 'ppc', 'ppc64', 'arm64'];
if (process.version.replace('v','').split('.').map(Number)[0] >= 12) { if (process.version.replace('v','').split('.').map(Number)[0] >= 12) {
// OK // OK
@@ -106,10 +102,8 @@ Builder.configure({
builder.config.cflags.push('-D', 'ADDRESS_PREFIX_BITS=' + process.env['ADDRESS_PREFIX_BITS']); builder.config.cflags.push('-D', 'ADDRESS_PREFIX_BITS=' + process.env['ADDRESS_PREFIX_BITS']);
} }
if (!builder.config.crossCompiling) { if (process.env['MARCH_NATIVE']) {
if (NO_MARCH_FLAG.indexOf(process.arch) == -1) { builder.config.cflags.push('-march=native');
builder.config.cflags.push('-march=native');
}
} }
if (builder.config.systemName === 'win32') { if (builder.config.systemName === 'win32') {