Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Jul 2023 20:43:33 +0100
From:      Jessica Clarke <jrtc27@freebsd.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: da3096a92d2c - main - rdrand_rng: Build with -fPIC on i386 when using GCC.
Message-ID:  <43225A5D-CBC7-4F1E-9B28-78A5A703FB56@freebsd.org>
In-Reply-To: <202307011923.361JNMtJ070354@gitrepo.freebsd.org>
References:  <202307011923.361JNMtJ070354@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 1 Jul 2023, at 20:23, John Baldwin <jhb@FreeBSD.org> wrote:
> 
> The branch main has been updated by jhb:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=da3096a92d2c1c06b25613444d9b369475d50321
> 
> commit da3096a92d2c1c06b25613444d9b369475d50321
> Author:     John Baldwin <jhb@FreeBSD.org>
> AuthorDate: 2023-07-01 19:23:00 +0000
> Commit:     John Baldwin <jhb@FreeBSD.org>
> CommitDate: 2023-07-01 19:23:00 +0000
> 
>    rdrand_rng: Build with -fPIC on i386 when using GCC.
> 
>    ld.bfd requires an R_386_PLT32 relocation for calls to ifuncs
>    rather than R_386_PC32.  (lld permits R_386_PC32.)

That’s odd and doesn’t quite seem a sufficient explanation on its own?
PDEs can have IFUNCs just fine today, so why is it different for kernel
modules here?

Jess

>    Reviewed by:    kib
>    Differential Revision:  https://reviews.freebsd.org/D40811
> ---
> sys/modules/rdrand_rng/Makefile | 5 +++++
> 1 file changed, 5 insertions(+)
> 
> diff --git a/sys/modules/rdrand_rng/Makefile b/sys/modules/rdrand_rng/Makefile
> index 7f14c080a260..3fdecd64f78f 100644
> --- a/sys/modules/rdrand_rng/Makefile
> +++ b/sys/modules/rdrand_rng/Makefile
> @@ -8,4 +8,9 @@ SRCS+= bus_if.h device_if.h
> 
> CFLAGS+= -I${SRCTOP}/sys
> 
> +# ld.bfd doesn't support ifuncs invoked non-PIC
> +.if ${MACHINE_CPUARCH} == "i386"
> +CFLAGS.gcc= -fPIC
> +.endif
> +
> .include <bsd.kmod.mk>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43225A5D-CBC7-4F1E-9B28-78A5A703FB56>