Hi Carlos, Sorry for the inconvenience. I have pushed a new patch and should be right now. Thanks, Yanzhang ________________________________ From: Carlos O'Donell Sent: Monday, August 14, 2023 9:12 PM To: Wang, Yanzhang ; libc-alpha@sourceware.org Subject: Re: [PATCH] RISC-V: Enable static-pie. On 8/10/23 19:33, yanzhang.wang--- via Libc-alpha wrote: > From: Yanzhang Wang > > This patch referents the commit 374cef3 to add static-pie support. And > because the dummy link map is used when relocating ourselves, so need > not to set __global_pointer$ at this time. This fails pre-commit CI. https://patchwork.sourceware.org/project/glibc/patch/20230810233348.1214955-1-yanzhang.wang@intel.com/ Patch conflict in configure. Please make sure you are regenerating properly. > --- > sysdeps/riscv/configure | 2 ++ > sysdeps/riscv/configure.ac | 3 +++ > sysdeps/riscv/dl-machine.h | 2 +- > 3 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/sysdeps/riscv/configure b/sysdeps/riscv/configure > index 2372225a26..340163779f 100644 > --- a/sysdeps/riscv/configure > +++ b/sysdeps/riscv/configure > @@ -29,3 +29,5 @@ fi > $as_echo "$libc_cv_riscv_r_align" >&6; } > config_vars="$config_vars > riscv-r-align = $libc_cv_riscv_r_align" > + > +$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h > diff --git a/sysdeps/riscv/configure.ac b/sysdeps/riscv/configure.ac > index dbcc216689..36da2b5396 100644 > --- a/sysdeps/riscv/configure.ac > +++ b/sysdeps/riscv/configure.ac > @@ -16,3 +16,6 @@ EOF > fi > rm -rf conftest.*]) > LIBC_CONFIG_VAR([riscv-r-align], [$libc_cv_riscv_r_align]) > + > +dnl Static PIE is supported. > +AC_DEFINE(SUPPORT_STATIC_PIE) > diff --git a/sysdeps/riscv/dl-machine.h b/sysdeps/riscv/dl-machine.h > index c0c9bd93ad..ad875c0828 100644 > --- a/sysdeps/riscv/dl-machine.h > +++ b/sysdeps/riscv/dl-machine.h > @@ -323,7 +323,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[], > gotplt[1] = (ElfW(Addr)) l; > } > > - if (l->l_type == lt_executable) > + if (l->l_type == lt_executable && l->l_scope != NULL) > { > /* The __global_pointer$ may not be defined by the linker if the > $gp register does not be used to access the global variable -- Cheers, Carlos.