From 33147c8b047a9fc9cbcca8fe9d806bab3e223a8b Mon Sep 17 00:00:00 2001 From: star9029 Date: Wed, 6 Nov 2024 13:22:53 +0800 Subject: [PATCH 01/16] verilator: switch to cmake --- packages/v/verilator/xmake.lua | 64 +++++++++++++++------------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/packages/v/verilator/xmake.lua b/packages/v/verilator/xmake.lua index a8dde10ba4c..826364da101 100644 --- a/packages/v/verilator/xmake.lua +++ b/packages/v/verilator/xmake.lua @@ -2,21 +2,22 @@ package("verilator") set_kind("toolchain") set_homepage("https://verilator.org") set_description("Verilator open-source SystemVerilog simulator and lint system") + set_license("LGPL-3.0") - add_urls("https://github.com/verilator/verilator/archive/refs/tags/$(version).tar.gz") - add_urls("https://github.com/verilator/verilator.git") + add_urls("https://github.com/verilator/verilator/archive/refs/tags/$(version).tar.gz", + "https://github.com/verilator/verilator.git") - add_versions("v5.016", "66fc36f65033e5ec904481dd3d0df56500e90c0bfca23b2ae21b4a8d39e05ef1") + add_versions("v5.030", "b9e7e97257ca3825fcc75acbed792b03c3ec411d6808ad209d20917705407eac") + + add_deps("cmake") on_load(function (package) if not package:is_precompiled() then if package:is_plat("windows") then - package:add("deps", "cmake") package:add("deps", "winflexbison", {kind = "library"}) else package:add("deps", "flex", {kind = "library"}) package:add("deps", "bison") - package:add("deps", "autoconf", "automake", "libtool") end package:add("deps", "python 3.x", {kind = "binary"}) end @@ -24,41 +25,34 @@ package("verilator") package:addenv("VERILATOR_ROOT", ".") end) - on_install("windows", function (package) + on_install(function (package) import("package.tools.cmake") - local configs = {} - local cxflags = {} - local winflexbison = package:dep("winflexbison") - local flex = winflexbison:fetch() - if flex then - local includedirs = flex.sysincludedirs or flex.includedirs - for _, includedir in ipairs(includedirs) do - table.insert(cxflags, "-I" .. includedir) - end + + io.replace("src/CMakeLists.txt", "MSVC_RUNTIME_LIBRARY MultiThreaded$,,DebugDLL>", "", {plain = true}) + + local configs = {"-DOBJCACHE_ENABLED=OFF", "-DDEBUG_AND_RELEASE_AND_COVERAGE=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + + local opt = {} + opt.envs = cmake.buildenvs(package) + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") + opt.envs.WIN_FLEX_BISON = package:dep("winflexbison"):installdir("include") end - local envs = cmake.buildenvs(package) - envs.VERILATOR_ROOT = nil - envs.WIN_FLEX_BISON = winflexbison:installdir() - io.replace("src/CMakeLists.txt", '${ASTGEN} -I"${srcdir}"', '${ASTGEN} -I "${srcdir}"', {plain = true}) - cmake.install(package, configs, {envs = envs, cxflags = cxflags}) - os.cp(path.join(package:installdir("bin"), "verilator_bin.exe"), path.join(package:installdir("bin"), "verilator.exe")) - end) + cmake.install(package, configs, opt) - on_install("linux", "macosx", function (package) - import("package.tools.autoconf") - local configs = {} - local cxflags = {} - local flex = package:dep("flex"):fetch() - if flex then - local includedirs = flex.sysincludedirs or flex.includedirs - for _, includedir in ipairs(includedirs) do - table.insert(cxflags, "-I" .. includedir) + local bindir = package:installdir("bin") + local subfix = (is_host("windows") and ".exe" or "") + local verilator = path.join(bindir, "verilator" .. subfix) + if not os.isfile(verilator) then + local verilator_bin = "verilator_bin" + if package:is_debug() then + verilator_bin = verilator_bin .. "_dbg" end + verilator_bin = path.join(bindir, verilator_bin .. subfix) + os.trycp(verilator_bin, verilator) end - os.vrun("autoconf") - local envs = autoconf.buildenvs(package, {cxflags = cxflags}) - envs.VERILATOR_ROOT = nil - autoconf.install(package, configs, {envs = envs}) end) on_test(function (package) From f8a625260089222358d15edf9ef8fe714caeccd1 Mon Sep 17 00:00:00 2001 From: star9029 Date: Wed, 6 Nov 2024 16:23:01 +0800 Subject: [PATCH 02/16] flex: fix msys --- packages/f/flex/xmake.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/f/flex/xmake.lua b/packages/f/flex/xmake.lua index 3c35a411d06..415cc8835ea 100644 --- a/packages/f/flex/xmake.lua +++ b/packages/f/flex/xmake.lua @@ -1,5 +1,5 @@ package("flex") - set_kind("binary") + set_kind("library") set_homepage("https://github.com/westes/flex/") set_license("BSD-2-Clause") @@ -15,11 +15,7 @@ package("flex") add_urls("https://github.com/westes/flex/releases/download/v$(version)/flex-$(version).tar.gz") end - if is_subhost("msys") then - add_deps("pacman::flex") - end - - on_load("macosx", "linux", "bsd", "windows", function (package) + on_load("macosx", "linux", "bsd", "windows", "@msys", function (package) if package:is_plat("windows") then package:add("deps", "winflexbison", {private = true}) elseif package:is_plat("linux") then @@ -35,6 +31,13 @@ package("flex") end) on_install("@msys", function (package) + os.vrun("pacman -Sy --noconfirm --needed --disable-download-timeout flex") + -- https://github.com/msys2/MSYS2-packages/issues/1911 + if package:is_library() then + local msys_dir = os.getenv("MINGW_PREFIX") + local header = path.join(path.directory(msys_dir), "usr/include/FlexLexer.h") + os.vcp(header, package:installdir("include")) + end end) on_install("windows", function (package) From 16f012a56fe8821575dd37097daff9be33e665eb Mon Sep 17 00:00:00 2001 From: star9029 Date: Wed, 6 Nov 2024 16:27:59 +0800 Subject: [PATCH 03/16] bison: fix msys --- packages/b/bison/xmake.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/b/bison/xmake.lua b/packages/b/bison/xmake.lua index 826280a9b99..dc00bd86b15 100644 --- a/packages/b/bison/xmake.lua +++ b/packages/b/bison/xmake.lua @@ -20,11 +20,7 @@ package("bison") add_versions("3.7.6", "69dc0bb46ea8fc307d4ca1e0b61c8c355eb207d0b0c69f4f8462328e74d7b9ea") add_versions("3.8.2", "06c9e13bdf7eb24d4ceb6b59205a4f67c2c7e7213119644430fe82fbd14a0abb") - if is_subhost("msys") then - add_deps("pacman::bison") - end - - on_load("macosx", "linux", "bsd", "windows", function (package) + on_load("macosx", "linux", "bsd", "windows", "@msys", function (package) if package:is_plat("windows") then package:add("deps", "winflexbison", {private = true}) elseif package:is_plat("linux", "bsd") then @@ -40,6 +36,7 @@ package("bison") end) on_install("@msys", function (package) + os.vrun("pacman -Sy --noconfirm --needed --disable-download-timeout bison") end) on_install("windows", function (package) From a644cd43b09b8ba47a38c86ac0d6660ae5959ba0 Mon Sep 17 00:00:00 2001 From: star9029 Date: Wed, 6 Nov 2024 16:37:10 +0800 Subject: [PATCH 04/16] verilator: fix flex --- packages/v/verilator/xmake.lua | 35 +++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/packages/v/verilator/xmake.lua b/packages/v/verilator/xmake.lua index 826364da101..615959e2e4d 100644 --- a/packages/v/verilator/xmake.lua +++ b/packages/v/verilator/xmake.lua @@ -13,12 +13,8 @@ package("verilator") on_load(function (package) if not package:is_precompiled() then - if package:is_plat("windows") then - package:add("deps", "winflexbison", {kind = "library"}) - else - package:add("deps", "flex", {kind = "library"}) - package:add("deps", "bison") - end + package:add("deps", "flex", {kind = "library"}) + package:add("deps", "bison") package:add("deps", "python 3.x", {kind = "binary"}) end package:mark_as_pathenv("VERILATOR_ROOT") @@ -29,16 +25,31 @@ package("verilator") import("package.tools.cmake") io.replace("src/CMakeLists.txt", "MSVC_RUNTIME_LIBRARY MultiThreaded$,,DebugDLL>", "", {plain = true}) + if is_subhost("msys") then + io.replace("CMakeLists.txt", "if(WIN32)", "if(0)", {plain = true}) + end - local configs = {"-DOBJCACHE_ENABLED=OFF", "-DDEBUG_AND_RELEASE_AND_COVERAGE=OFF"} + local configs = { + "-DOBJCACHE_ENABLED=OFF", + "-DDEBUG_AND_RELEASE_AND_COVERAGE=OFF", + "-DCMAKE_CXX_STANDARD=20", + } table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") + end local opt = {} opt.envs = cmake.buildenvs(package) - if package:is_plat("windows") then - table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") - opt.envs.WIN_FLEX_BISON = package:dep("winflexbison"):installdir("include") + if is_host("windows") then + local winflexbison = package:dep("winflexbison") + if winflexbison then + opt.envs.WIN_FLEX_BISON = winflexbison:installdir("include") + else + local flex = package:dep("flex") + table.insert(configs, "-DFLEX_INCLUDE_DIR=" .. flex:installdir("include")) + end end cmake.install(package, configs, opt) @@ -56,5 +67,7 @@ package("verilator") end) on_test(function (package) - os.vrun("verilator --version") + if not package:is_cross() then + os.vrun("verilator --version") + end end) From 61d7a841d079c3edfb3a21949aa4ff423f063d9b Mon Sep 17 00:00:00 2001 From: star9029 Date: Wed, 6 Nov 2024 16:40:54 +0800 Subject: [PATCH 05/16] verilator: use old version --- packages/v/verilator/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/v/verilator/xmake.lua b/packages/v/verilator/xmake.lua index 615959e2e4d..3cd36b944ff 100644 --- a/packages/v/verilator/xmake.lua +++ b/packages/v/verilator/xmake.lua @@ -7,7 +7,7 @@ package("verilator") add_urls("https://github.com/verilator/verilator/archive/refs/tags/$(version).tar.gz", "https://github.com/verilator/verilator.git") - add_versions("v5.030", "b9e7e97257ca3825fcc75acbed792b03c3ec411d6808ad209d20917705407eac") + add_versions("v5.016", "66fc36f65033e5ec904481dd3d0df56500e90c0bfca23b2ae21b4a8d39e05ef1") add_deps("cmake") From c86ead806d3d74834380cdc40d9ea1fd004d5207 Mon Sep 17 00:00:00 2001 From: star9029 Date: Wed, 6 Nov 2024 23:25:13 +0800 Subject: [PATCH 06/16] flex: add configs for autotools --- packages/f/flex/xmake.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/f/flex/xmake.lua b/packages/f/flex/xmake.lua index 415cc8835ea..2104b513bc4 100644 --- a/packages/f/flex/xmake.lua +++ b/packages/f/flex/xmake.lua @@ -1,5 +1,5 @@ package("flex") - set_kind("library") + set_kind("binary") set_homepage("https://github.com/westes/flex/") set_license("BSD-2-Clause") @@ -46,7 +46,13 @@ package("flex") end) on_install("macosx", "linux", "bsd", "android", "iphoneos", "cross", function (package) - import("package.tools.autoconf").install(package) + local configs = {} + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) + if package:is_debug() then + table.insert(configs, "--enable-debug") + end + import("package.tools.autoconf").install(package, configs) end) on_test(function (package) From 65b9e349212e9f929f98e83a65a4591887baa659 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sun, 10 Nov 2024 14:13:02 +0800 Subject: [PATCH 07/16] flex: fix include --- packages/f/flex/xmake.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/f/flex/xmake.lua b/packages/f/flex/xmake.lua index 2104b513bc4..c59acc50e49 100644 --- a/packages/f/flex/xmake.lua +++ b/packages/f/flex/xmake.lua @@ -15,6 +15,15 @@ package("flex") add_urls("https://github.com/westes/flex/releases/download/v$(version)/flex-$(version).tar.gz") end + on_fetch(function (package) + -- If pacman::flex already installed + if is_subhost("msys") and package:is_library() then + local msys_dir = os.getenv("MINGW_PREFIX") + local header = path.join(path.directory(msys_dir), "usr/include/FlexLexer.h") + os.trycp(header, package:installdir("include")) + end + end) + on_load("macosx", "linux", "bsd", "windows", "@msys", function (package) if package:is_plat("windows") then package:add("deps", "winflexbison", {private = true}) From 931273b936cc46ea7238eadb3ce379039c50b1e6 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sun, 10 Nov 2024 14:36:00 +0800 Subject: [PATCH 08/16] patch mingw --- packages/v/verilator/xmake.lua | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/packages/v/verilator/xmake.lua b/packages/v/verilator/xmake.lua index 3cd36b944ff..991e972dc37 100644 --- a/packages/v/verilator/xmake.lua +++ b/packages/v/verilator/xmake.lua @@ -24,11 +24,33 @@ package("verilator") on_install(function (package) import("package.tools.cmake") - io.replace("src/CMakeLists.txt", "MSVC_RUNTIME_LIBRARY MultiThreaded$,,DebugDLL>", "", {plain = true}) if is_subhost("msys") then io.replace("CMakeLists.txt", "if(WIN32)", "if(0)", {plain = true}) end + local version = package:version() + if version then + if version:ge("5.030") then + io.replace("src/CMakeLists.txt", "MSVC_RUNTIME_LIBRARY MultiThreaded$,,DebugDLL>", "", {plain = true}) + else + io.replace("src/CMakeLists.txt", "MSVC_RUNTIME_LIBRARY MultiThreaded$,,DebugDLL>", "", {plain = true}) + if version:lt("5.028") then + if is_host("linux", "bsd") then + io.replace("src/CMakeLists.txt", "install(TARGETS ${verilator})", + "target_link_libraries(${verilator} PRIVATE pthread)\ninstall(TARGETS ${verilator})", {plain = true}) + end + + if version:lt("5.020") then + if is_host("windows") and not package:has_tool("cxx", "cl") then + io.replace("src/CMakeLists.txt", "/bigobj", "-Wa,-mbig-obj", {plain = true}) + io.replace("src/CMakeLists.txt", "YY_NO_UNISTD_H", "", {plain = true}) + io.replace("src/CMakeLists.txt", "/STACK:10000000", "-Wl,--stack,10000000 -mconsole -lcomctl32 -DWIN_32_LEAN_AND_MEAN", {plain = true}) + end + end + end + end + end + local configs = { "-DOBJCACHE_ENABLED=OFF", "-DDEBUG_AND_RELEASE_AND_COVERAGE=OFF", @@ -48,7 +70,12 @@ package("verilator") opt.envs.WIN_FLEX_BISON = winflexbison:installdir("include") else local flex = package:dep("flex") - table.insert(configs, "-DFLEX_INCLUDE_DIR=" .. flex:installdir("include")) + local includedir = flex:installdir("include") + if version and version:lt("5.026") then + opt.cxflags = "-I" .. includedir + else + table.insert(configs, "-DFLEX_INCLUDE_DIR=" .. includedir) + end end end cmake.install(package, configs, opt) From ac036596183f4d1ab05727a8f319aa98b97d898d Mon Sep 17 00:00:00 2001 From: star9029 Date: Sun, 10 Nov 2024 21:23:51 +0800 Subject: [PATCH 09/16] fix mingw lto --- packages/v/verilator/xmake.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/v/verilator/xmake.lua b/packages/v/verilator/xmake.lua index 991e972dc37..e659a699c74 100644 --- a/packages/v/verilator/xmake.lua +++ b/packages/v/verilator/xmake.lua @@ -42,6 +42,7 @@ package("verilator") if version:lt("5.020") then if is_host("windows") and not package:has_tool("cxx", "cl") then + io.replace("src/CMakeLists.txt", "INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE", "", {plain = true}) io.replace("src/CMakeLists.txt", "/bigobj", "-Wa,-mbig-obj", {plain = true}) io.replace("src/CMakeLists.txt", "YY_NO_UNISTD_H", "", {plain = true}) io.replace("src/CMakeLists.txt", "/STACK:10000000", "-Wl,--stack,10000000 -mconsole -lcomctl32 -DWIN_32_LEAN_AND_MEAN", {plain = true}) From a3684fe48708c42c86149a0b06a72df7c4f2ce7b Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 11 Nov 2024 08:57:44 +0800 Subject: [PATCH 10/16] try to fix flex for mac --- packages/v/verilator/xmake.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/v/verilator/xmake.lua b/packages/v/verilator/xmake.lua index e659a699c74..82ab0a38de2 100644 --- a/packages/v/verilator/xmake.lua +++ b/packages/v/verilator/xmake.lua @@ -65,12 +65,13 @@ package("verilator") local opt = {} opt.envs = cmake.buildenvs(package) - if is_host("windows") then - local winflexbison = package:dep("winflexbison") - if winflexbison then - opt.envs.WIN_FLEX_BISON = winflexbison:installdir("include") - else - local flex = package:dep("flex") + local winflexbison = package:dep("winflexbison") + if winflexbison then + opt.envs.WIN_FLEX_BISON = winflexbison:installdir("include") + else + local flex = package:dep("flex") + -- https://github.com/verilator/verilator/issues/3487 + if is_subhost("msys") or not flex:is_system() then local includedir = flex:installdir("include") if version and version:lt("5.026") then opt.cxflags = "-I" .. includedir From b6c792e7d8b063afbbf004b06a17ea52dc753a87 Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 11 Nov 2024 18:29:37 +0800 Subject: [PATCH 11/16] remove std=c++20 for linux --- packages/v/verilator/xmake.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/v/verilator/xmake.lua b/packages/v/verilator/xmake.lua index 82ab0a38de2..c70ce496855 100644 --- a/packages/v/verilator/xmake.lua +++ b/packages/v/verilator/xmake.lua @@ -55,13 +55,15 @@ package("verilator") local configs = { "-DOBJCACHE_ENABLED=OFF", "-DDEBUG_AND_RELEASE_AND_COVERAGE=OFF", - "-DCMAKE_CXX_STANDARD=20", } table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) if package:is_plat("windows") then table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") end + if not is_host("linux") then + table.insert(configs, "-DCMAKE_CXX_STANDARD=20") + end local opt = {} opt.envs = cmake.buildenvs(package) From abed7522dcb2f6af981e92014e3bd8a0f925a903 Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 11 Nov 2024 20:12:42 +0800 Subject: [PATCH 12/16] get verbose info --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index be882cffa51..0a185c9095e 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -34,4 +34,4 @@ jobs: - name: Tests run: | - xmake l ./scripts/test.lua -D -k ${{ matrix.kind }} -m ${{ matrix.mode }} + xmake l ./scripts/test.lua -vD -k ${{ matrix.kind }} -m ${{ matrix.mode }} From 03bf7231792873689d36527d92757285007ddfea Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 11 Nov 2024 22:08:46 +0800 Subject: [PATCH 13/16] Revert "get verbose info" This reverts commit abed7522dcb2f6af981e92014e3bd8a0f925a903. --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 0a185c9095e..be882cffa51 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -34,4 +34,4 @@ jobs: - name: Tests run: | - xmake l ./scripts/test.lua -vD -k ${{ matrix.kind }} -m ${{ matrix.mode }} + xmake l ./scripts/test.lua -D -k ${{ matrix.kind }} -m ${{ matrix.mode }} From fe82a0530782f236cd7ccf686134f06fead3a6eb Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 11 Nov 2024 22:27:03 +0800 Subject: [PATCH 14/16] improve cp exe --- packages/v/verilator/xmake.lua | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/v/verilator/xmake.lua b/packages/v/verilator/xmake.lua index c70ce496855..fcacc4485d5 100644 --- a/packages/v/verilator/xmake.lua +++ b/packages/v/verilator/xmake.lua @@ -84,21 +84,24 @@ package("verilator") end cmake.install(package, configs, opt) - local bindir = package:installdir("bin") - local subfix = (is_host("windows") and ".exe" or "") - local verilator = path.join(bindir, "verilator" .. subfix) - if not os.isfile(verilator) then - local verilator_bin = "verilator_bin" - if package:is_debug() then - verilator_bin = verilator_bin .. "_dbg" + if is_host("windows") then + local bindir = package:installdir("bin") + local verilator = path.join(bindir, "verilator.exe") + if not os.isfile(verilator) then + local verilator_bin = "verilator_bin" + if package:is_debug() then + verilator_bin = verilator_bin .. "_dbg" + end + verilator_bin = path.join(bindir, verilator_bin .. ".exe") + os.trycp(verilator_bin, verilator) + end + + if package:is_plat("windows") and package:is_debug() then + os.vcp(path.join(package:buildir(), "**.pdb"), package:installdir("bin")) end - verilator_bin = path.join(bindir, verilator_bin .. subfix) - os.trycp(verilator_bin, verilator) end end) on_test(function (package) - if not package:is_cross() then - os.vrun("verilator --version") - end + os.vrun("verilator --version") end) From d708e8053d489a23f7b6143d85a5bc079fcbc66e Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 11 Nov 2024 23:12:19 +0800 Subject: [PATCH 15/16] fix debug build on linux --- packages/v/verilator/xmake.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/v/verilator/xmake.lua b/packages/v/verilator/xmake.lua index fcacc4485d5..d99de8b693b 100644 --- a/packages/v/verilator/xmake.lua +++ b/packages/v/verilator/xmake.lua @@ -84,7 +84,12 @@ package("verilator") end cmake.install(package, configs, opt) - if is_host("windows") then + if is_host("linux") then + if package:is_debug() then + local bindir = package:installdir("bin") + os.ln(path.join(bindir, "verilator_bin_debug"), path.join(bindir, "verilator_bin")) + end + elseif is_host("windows") then local bindir = package:installdir("bin") local verilator = path.join(bindir, "verilator.exe") if not os.isfile(verilator) then From 999b2e4f90d66c049548014af459c512c8856126 Mon Sep 17 00:00:00 2001 From: star9029 Date: Tue, 12 Nov 2024 00:23:30 +0800 Subject: [PATCH 16/16] fix verilator name --- packages/v/verilator/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/v/verilator/xmake.lua b/packages/v/verilator/xmake.lua index d99de8b693b..498a530fb3e 100644 --- a/packages/v/verilator/xmake.lua +++ b/packages/v/verilator/xmake.lua @@ -87,7 +87,7 @@ package("verilator") if is_host("linux") then if package:is_debug() then local bindir = package:installdir("bin") - os.ln(path.join(bindir, "verilator_bin_debug"), path.join(bindir, "verilator_bin")) + os.ln(path.join(bindir, "verilator_bin_dbg"), path.join(bindir, "verilator_bin")) end elseif is_host("windows") then local bindir = package:installdir("bin")