NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: port-sparc64/61087: NetBSD 11.1 RELEASE kernel fails to build for sparc64 with KUBSAN enabled
The following reply was made to PR port-sparc64/61087; it has been noted by GNATS.
From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: port-sparc64/61087: NetBSD 11.1 RELEASE kernel fails to build
for sparc64 with KUBSAN enabled
Date: Tue, 1 Dec 2026 16:48:05 +0300
A localized kludge might help for now:
--- rasops_masks.h.~1.9.~
+++ rasops_masks.h
@@ -76,11 +76,11 @@
/* Put a number of bits ( <= 32 ) from sw to *dp */
#define PUTBITS(sw, x, w, dp) do { \
- int n = (x) + (w) - 32; \
- if (n <= 0) { \
+ if (((x) + (w)) <= 32) { \
uint32_t mask = rasops_pmask[(x) & 31][(w) & 31]; \
*(dp) = (*(dp) & ~mask) | (MBR(sw, x) & mask); \
} else { \
+ unsigned int n = (x) + (w) - 32; \
*(dp) = (*(dp) & rasops_rmask[x]) | (MBR(sw, x)); \
(dp)[1] = ((dp)[1] & rasops_rmask[n]) | \
(MBL(sw, 32-(x)) & rasops_lmask[n]); \
This kludge makes the rasops files compile on current and 11, but I
don't have any headful machines to test this on.
PS
Of course then the linking of the kernel fails b/c the order of the
objects is suboptimal and inflated sanitized objects are too big, so
locore.o: in function `cpu_mp_startup':
(.text+0x1254c): relocation truncated to fit: R_SPARC_WDISP22 against symbol `idle_loop' defined in .text section in kern_idle.o
lock_stubs.o: in function `mutex_enter':
(.text+0x20): relocation truncated to fit: R_SPARC_WDISP22 against symbol `mutex_vector_enter' defined in .text section in kern_mutex.o
lock_stubs.o: in function `mutex_exit':
(.text+0x68): relocation truncated to fit: R_SPARC_WDISP22 against symbol `mutex_vector_exit' defined in .text section in kern_mutex.o
but that's another problem (you can fix this manually by tweaking the
order of ALLFILES).
-uwe
Home |
Main Index |
Thread Index |
Old Index