armv7: remove gcc support from kernel Makefile

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

armv7: remove gcc support from kernel Makefile

Christian Weisgerber
This drops support for building the armv7 kernel with gcc and reduces
the difference to arm64.

I can't test this.

OK?  Or it can be rolled into somebody else's larger "remove gcc
from armv7" diff.

Index: arch/armv7/conf/Makefile.armv7
===================================================================
RCS file: /cvs/src/sys/arch/armv7/conf/Makefile.armv7,v
retrieving revision 1.45
diff -u -p -r1.45 Makefile.armv7
--- arch/armv7/conf/Makefile.armv7 21 Jun 2019 15:34:07 -0000 1.45
+++ arch/armv7/conf/Makefile.armv7 2 Sep 2019 15:26:17 -0000
@@ -25,14 +25,10 @@ INCLUDES= -nostdinc -I$S -I. -I$S/arch
 CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP
 CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \
  -Wno-uninitialized -Wno-pointer-sign \
+ -Wno-constant-conversion -Wno-address-of-packed-member \
  -Wframe-larger-than=2047
 
-CMACHFLAGS= -msoft-float
-.if ${COMPILER_VERSION:Mgcc4}
-CMACHFLAGS+= -march=armv6 -Wa,-march=armv7a
-.else
-CMACHFLAGS+= -march=armv7a
-.endif
+CMACHFLAGS= -msoft-float -march=armv7a
 CMACHFLAGS+= -ffreestanding ${NOPIE_FLAGS}
 SORTR= sort -R
 .if ${IDENT:M-DNO_PROPOLICE}
@@ -42,10 +38,6 @@ CMACHFLAGS+= -fno-stack-protector
 SORTR= cat
 COPTS?= -Oz
 .endif
-.if ${COMPILER_VERSION:Mclang}
-NO_INTEGR_AS= -no-integrated-as
-CWARNFLAGS+= -Wno-address-of-packed-member -Wno-constant-conversion
-.endif
 
 DEBUG?= -g
 COPTS?= -O2
@@ -103,7 +95,7 @@ LINKFLAGS+= -S
 assym.h: $S/kern/genassym.sh Makefile \
  ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf
  cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \
-    sh $S/kern/genassym.sh ${CC} ${NO_INTEGR_AS} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp
+    sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -no-integrated-as -MF assym.P > assym.h.tmp
  sed '1s/.*/assym.h: \\/' assym.P > assym.d
  sort -u assym.h.tmp > assym.h
 
--
Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: armv7: remove gcc support from kernel Makefile

Theo de Raadt-2
> OK?  Or it can be rolled into somebody else's larger "remove gcc
> from armv7" diff.

This is fine with me as-is.

Reply | Threaded
Open this post in threaded view
|

Re: armv7: remove gcc support from kernel Makefile

Mark Kettenis
In reply to this post by Christian Weisgerber
> Date: Mon, 2 Sep 2019 17:32:04 +0200
> From: Christian Weisgerber <[hidden email]>
>
> This drops support for building the armv7 kernel with gcc and reduces
> the difference to arm64.
>
> I can't test this.
>
> OK?  Or it can be rolled into somebody else's larger "remove gcc
> from armv7" diff.

If we're keeping the gcc bits on other architectures, it makes sense
to keep it here as well.  Helps with diffability and someone might
want to run the same tools for armv7 at some point.

> Index: arch/armv7/conf/Makefile.armv7
> ===================================================================
> RCS file: /cvs/src/sys/arch/armv7/conf/Makefile.armv7,v
> retrieving revision 1.45
> diff -u -p -r1.45 Makefile.armv7
> --- arch/armv7/conf/Makefile.armv7 21 Jun 2019 15:34:07 -0000 1.45
> +++ arch/armv7/conf/Makefile.armv7 2 Sep 2019 15:26:17 -0000
> @@ -25,14 +25,10 @@ INCLUDES= -nostdinc -I$S -I. -I$S/arch
>  CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP
>  CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \
>   -Wno-uninitialized -Wno-pointer-sign \
> + -Wno-constant-conversion -Wno-address-of-packed-member \
>   -Wframe-larger-than=2047
>  
> -CMACHFLAGS= -msoft-float
> -.if ${COMPILER_VERSION:Mgcc4}
> -CMACHFLAGS+= -march=armv6 -Wa,-march=armv7a
> -.else
> -CMACHFLAGS+= -march=armv7a
> -.endif
> +CMACHFLAGS= -msoft-float -march=armv7a
>  CMACHFLAGS+= -ffreestanding ${NOPIE_FLAGS}
>  SORTR= sort -R
>  .if ${IDENT:M-DNO_PROPOLICE}
> @@ -42,10 +38,6 @@ CMACHFLAGS+= -fno-stack-protector
>  SORTR= cat
>  COPTS?= -Oz
>  .endif
> -.if ${COMPILER_VERSION:Mclang}
> -NO_INTEGR_AS= -no-integrated-as
> -CWARNFLAGS+= -Wno-address-of-packed-member -Wno-constant-conversion
> -.endif
>  
>  DEBUG?= -g
>  COPTS?= -O2
> @@ -103,7 +95,7 @@ LINKFLAGS+= -S
>  assym.h: $S/kern/genassym.sh Makefile \
>   ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf
>   cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \
> -    sh $S/kern/genassym.sh ${CC} ${NO_INTEGR_AS} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp
> +    sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -no-integrated-as -MF assym.P > assym.h.tmp
>   sed '1s/.*/assym.h: \\/' assym.P > assym.d
>   sort -u assym.h.tmp > assym.h
>  
> --
> Christian "naddy" Weisgerber                          [hidden email]
>
>

Reply | Threaded
Open this post in threaded view
|

Re: armv7: remove gcc support from kernel Makefile

Theo de Raadt-2
Mark Kettenis <[hidden email]> wrote:

> > Date: Mon, 2 Sep 2019 17:32:04 +0200
> > From: Christian Weisgerber <[hidden email]>
> >
> > This drops support for building the armv7 kernel with gcc and reduces
> > the difference to arm64.
> >
> > I can't test this.
> >
> > OK?  Or it can be rolled into somebody else's larger "remove gcc
> > from armv7" diff.
>
> If we're keeping the gcc bits on other architectures, it makes sense
> to keep it here as well.  Helps with diffability and someone might
> want to run the same tools for armv7 at some point.

Perhaps, perhaps.

It is fragile.  These stanzas will break.  When they do, someone has
to tweak them to get gcc to build the kernel.  But at least they have
a starting point, so that's not terribly bad.

So yeah, maybe let's keep that around.

I also consider it very important that we try to keep the Makefile.* files
on all the architectures "maximally diffable".  Another aspect where we
don't need surprises.

Reply | Threaded
Open this post in threaded view
|

Re: armv7: remove gcc support from kernel Makefile

Christian Weisgerber
In reply to this post by Mark Kettenis
Mark Kettenis:

> > This drops support for building the armv7 kernel with gcc and reduces
> > the difference to arm64.
>
> If we're keeping the gcc bits on other architectures, it makes sense
> to keep it here as well.  Helps with diffability and someone might
> want to run the same tools for armv7 at some point.

Well, arm64 does not have any gcc bits there and this diff (which
I already committed, oops) reduces the difference between Makefile.armv7
and Makefile.arm64.

--
Christian "naddy" Weisgerber                          [hidden email]