1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-07 16:59:22 +00:00

newlib: Use mcmodel=medany for RISCV64

It was previously discovered that mcmodel=medany should be used for RISCV64,
however this was only being set for the applications themselves, but not for
newlib, this meant that we ended up with C library that used a code model and
an application that used another one which is not something we want.

Pass mcmodel=medany when building newlib for RISCV64 as well.

Also, s/CFLAGS/TARGET_CFLAGS to standarize across recipes, the variable
expansion provides no functional difference at this point.

(From OE-Core rev: 3ed0a2fab5dbc37dd352ead8846da6aae5de5c20)

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alejandro Hernandez Samaniego
2024-05-18 23:50:47 -06:00
committed by Richard Purdie
parent 09b5bafd0d
commit 40d1877faf
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ QB_OPT_APPEND:append:qemuriscv32 = " -bios none"
# since medlow can only access addresses below 0x80000000 and RAM
# starts at 0x80000000 on RISC-V 64
# Keep RISC-V 32 using -mcmodel=medlow (symbols lie between -2GB:2GB)
CFLAGS:append:qemuriscv64 = " -mcmodel=medany"
TARGET_CFLAGS:append:qemuriscv64 = " -mcmodel=medany"
## Emulate image.bbclass
+8
View File
@@ -28,6 +28,14 @@ B = "${WORKDIR}/build"
## disable stdlib
TARGET_CC_ARCH:append = " -nostdlib"
# Both the C library and the application should share the same mcmodel.
# Use the medium-any code model for the RISC-V 64 bit implementation,
# since medlow can only access addresses below 0x80000000 and RAM
# starts at 0x80000000 on RISC-V 64
# Keep RISC-V 32 using -mcmodel=medlow (symbols lie between -2GB:2GB)
TARGET_CFLAGS:append:qemuriscv64 = " -mcmodel=medany"
EXTRA_OECONF = " \
--build=${BUILD_SYS} \
--target=${TARGET_SYS} \