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

Fix clang 16.0.4 Compilation on Windows #678

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion cmake/BCCompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set(DEFAULT_BC_COMPILER_FLAGS
-ffreestanding -fno-common -fno-builtin -fno-exceptions -fno-rtti
-fno-asynchronous-unwind-tables -Wno-unneeded-internal-declaration
-Wno-unused-function -Wgnu-inline-cpp-without-extern
-Wno-pass-failed=transform-warning
-Wno-pass-failed=transform-warning -fshort-wchar -Xclang -mlong-double-80
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL about -mlong-double-80.

${EXTRA_BC_SYSROOT}
)

Expand Down
4 changes: 3 additions & 1 deletion lib/Arch/AArch32/Runtime/Instructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@

// A definition is required to ensure that LLVM doesn't optimize the `State` type out of the bytecode
// See https://github.com/lifting-bits/remill/pull/631#issuecomment-1279989004
State __remill_state;
extern "C" {
extern State __remill_state = {};
} // extern C

#define REG_PC state.gpr.r15.dword
#define REG_LR state.gpr.r14.dword
Expand Down
4 changes: 3 additions & 1 deletion lib/Arch/AArch64/Runtime/Instructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@

// A definition is required to ensure that LLVM doesn't optimize the `State` type out of the bytecode
// See https://github.com/lifting-bits/remill/pull/631#issuecomment-1279989004
State __remill_state;
extern "C" {
extern State __remill_state = {};
} // extern C

#define REG_PC state.gpr.pc.qword
#define REG_SP state.gpr.sp.qword
Expand Down
4 changes: 3 additions & 1 deletion lib/Arch/PPC/Runtime/Instructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

// A definition is required to ensure that LLVM doesn't optimize the `State` type out of the bytecode
// See https://github.com/lifting-bits/remill/pull/631#issuecomment-1279989004f
State __remill_state;
extern "C" {
extern State __remill_state = {};
} // extern C

#define HYPER_CALL state.hyper_call

Expand Down
4 changes: 3 additions & 1 deletion lib/Arch/Runtime/Intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ extern "C" void __remill_mark_as_used(const void *);

// Each architecture's semantics module defines this variable
// See https://github.com/lifting-bits/remill/pull/631#issuecomment-1279989004
extern State __remill_state;
extern "C" {
extern State __remill_state ;
} // extern C

#if defined(REMILL_ON_SPARC32) || defined(REMILL_ON_SPARC64)
extern RegisterWindow __remill_register_window;
Expand Down
4 changes: 3 additions & 1 deletion lib/Arch/SPARC32/Runtime/Instructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@

// A definition is required to ensure that LLVM doesn't optimize the `State` type out of the bytecode
// See https://github.com/lifting-bits/remill/pull/631#issuecomment-1279989004
State __remill_state;
extern "C" {
extern State __remill_state = {};
} // extern C

#define REG_PC state.pc.aword
#define REG_NPC state.next_pc.aword
Expand Down
4 changes: 3 additions & 1 deletion lib/Arch/SPARC64/Runtime/Instructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@

// A definition is required to ensure that LLVM doesn't optimize the `State` type out of the bytecode
// See https://github.com/lifting-bits/remill/pull/631#issuecomment-1279989004
State __remill_state;
extern "C" {
extern State __remill_state = {};
} // extern C

#define REG_PC state.pc.aword
#define REG_NPC state.next_pc.aword
Expand Down
4 changes: 3 additions & 1 deletion lib/Arch/X86/Runtime/Instructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@

// A definition is required to ensure that LLVM doesn't optimize the `State` type out of the bytecode
// See https://github.com/lifting-bits/remill/pull/631#issuecomment-1279989004
State __remill_state;
extern "C" {
extern State __remill_state = {};
} // extern C

#define REG_IP state.gpr.rip.word
#define REG_EIP state.gpr.rip.dword
Expand Down