Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve vectorext #5114

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions xmake/core/tool/tool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ local sandbox = require("sandbox/sandbox")
local toolchain = require("tool/toolchain")
local platform = require("platform/platform")
local language = require("language/language")
local is_cross = require("base/private/is_cross")
local import = require("sandbox/modules/import")

-- new an instance
Expand Down Expand Up @@ -111,6 +112,11 @@ function _instance:is_arch(...)
end
end

-- is cross-compilation?
function _instance:is_cross()
return is_cross(self:plat(), self:arch())
end

-- get the tool program
function _instance:program()
return self._PROGRAM
Expand Down
4 changes: 4 additions & 0 deletions xmake/modules/core/tools/gcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ function nf_vectorext(self, extension)
, neon = "-mfpu=neon"
, all = "-march=native"
}
if extension == "all" and self:is_cross() then
-- https://github.com/xmake-io/xmake-repo/pull/4040#discussion_r1605121207
maps[extension] = nil
end
return maps[extension]
end

Expand Down
Loading