[PATCH v4 02/26] arm64/sysreg: Add LINKER_SCRIPT guards for sysreg.h

Mark Rutland mark.rutland at arm.com
Wed Jun 22 08:20:20 PDT 2022


On Wed, Jun 22, 2022 at 12:19:54PM +0100, Mark Brown wrote:
> On Wed, Jun 22, 2022 at 12:11:10PM +0100, Mark Rutland wrote:
> > On Mon, Jun 20, 2022 at 01:43:43PM +0100, Mark Brown wrote:
> > > Linker scripts are preprocessed with __ASSEMBLY__ defined which works well
> > > for most things but not for assembler macros. In preparation for allowing
> > > sysreg.h to be included in linker files add some LINKER_SCRIPT guard
> > > defines around assembler macros in headers so the headers are safe for
> > > inclusion in linker scripts.
> 
> > Where does that need to happen?
> 
> > I couldn't spot a direct include; does that happen as a transitive dependency
> > later in the series?
> 
> Yes, it's pulled in as a result of one of the patches in the series.
> IIRC it's cache.h that's currently included in the linker scripts.

Ok; could we please mention something like that explciitly in the commit
message, e.g.
  
  In subsequent patches sysreg.h and gpr-num.h will be included from other
  headers which can be included from linker scripts (e.g. via cache.h), and
  contain assember macro directives that don't work in linker scripts (e.g.
  `.macro` and `.irp`).

  To avoid needing LINKER_SCRIPT guards in every file which could have a
  transitive dependency, add those directly to sysreg.h and gpr-num.h.

... just so that it's clear that's a transitive dependency, and difficult to
refactor in other ways to avoid.

Thanks,
Mark.



More information about the linux-arm-kernel mailing list