Allow building with g++ as C compiler - lightning.git - Portable just-in-time compiler library

index : lightning.git
Portable just-in-time compiler library
summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2023年08月16日 09:59:48 -0300
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2023年08月16日 09:59:48 -0300
commit3d72aba731677c1c262692a584bd41b6b12c792e (patch)
treecf383fa7b50f94231c29e1f0c1fbac1d1bacdf7f /lib
parent60254fb663d71c4d3bf81e7dca6d7d940ec99934 (diff)
downloadlightning-3d72aba731677c1c262692a584bd41b6b12c792e.tar.gz
Allow building with g++ as C compiler
This change fixes the build errors and finishes with gcc 13, with several warnings, on x86_64. It will not build with disassembler enabled unless extra customizations are done. Besides working, for x86_64 after this commit, Lightning should not be built with a C++ compiler.
Diffstat (limited to 'lib')
-rw-r--r--lib/jit_x86-cpu.c 4
-rw-r--r--lib/lightning.c 10
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/jit_x86-cpu.c b/lib/jit_x86-cpu.c
index e185d14..47529cf 100644
--- a/lib/jit_x86-cpu.c
+++ b/lib/jit_x86-cpu.c
@@ -50,8 +50,8 @@
# define stxr(u, v, w) stxr_l(u, v, w)
# define stxi(u, v, w) stxi_l(u, v, w)
# define can_sign_extend_int_p(im) \
- (((im) >= 0 && (long long)(im) <= 0x7fffffffLL) || \
- ((im) < 0 && (long long)(im) > -0x80000000LL))
+ (((long long)(im) >= 0 && (long long)(im) <= 0x7fffffffLL) || \
+ ((long long)(im) < 0 && (long long)(im) > -0x80000000LL))
# define can_zero_extend_int_p(im) \
((im) >= 0 && (im) < 0x80000000LL)
# define fits_uint32_p(im) (((im) & 0xffffffff00000000LL) == 0)
diff --git a/lib/lightning.c b/lib/lightning.c
index 3d98663..d1d8ffc 100644
--- a/lib/lightning.c
+++ b/lib/lightning.c
@@ -2553,12 +2553,12 @@ _jit_emit(jit_state_t *_jit)
assert(result == 0);
}
if (!_jit->user_code) {
- _jit->code.protected = _jit->pc.uc - _jit->code.ptr;
+ _jit->code.protect = _jit->pc.uc - _jit->code.ptr;
# if __riscv && __WORDSIZE == 64
/* FIXME should start adding consts at a page boundary */
- _jit->code.protected -= _jitc->consts.hash.count * sizeof(jit_word_t);
+ _jit->code.protect -= _jitc->consts.hash.count * sizeof(jit_word_t);
# endif
- result = mprotect(_jit->code.ptr, _jit->code.protected, PROT_READ | PROT_EXEC);
+ result = mprotect(_jit->code.ptr, _jit->code.protect, PROT_READ | PROT_EXEC);
assert(result == 0);
}
#endif /* HAVE_MMAP */
@@ -2576,7 +2576,7 @@ _jit_protect(jit_state_t *_jit)
#else
int result;
if (_jit->user_code) return;
- result = mprotect (_jit->code.ptr, _jit->code.protected, PROT_READ | PROT_EXEC);
+ result = mprotect (_jit->code.ptr, _jit->code.protect, PROT_READ | PROT_EXEC);
assert (result == 0);
#endif
}
@@ -2589,7 +2589,7 @@ _jit_unprotect(jit_state_t *_jit)
#else
int result;
if (_jit->user_code) return;
- result = mprotect (_jit->code.ptr, _jit->code.protected, PROT_READ | PROT_WRITE);
+ result = mprotect (_jit->code.ptr, _jit->code.protect, PROT_READ | PROT_WRITE);
assert (result == 0);
#endif
}
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月17日 10:28:36 +0000

AltStyle によって変換されたページ (->オリジナル) /