diff mbox series

[xenial/master-next,2/2] UBUNTU: [Packaging] include the retpoline extractor in the headers

Message ID 20180403165249.15489-10-apw@canonical.com
State New
Headers show
Series None | expand

Commit Message

Andy Whitcroft April 3, 2018, 4:52 p.m. UTC
BugLink: http://bugs.launchpad.net/bugs/1760876
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 debian/rules                    | 6 +++++-
 debian/rules.d/2-binary-arch.mk | 2 ++
 scripts/Makefile.build          | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

Comments

Juerg Haefliger April 4, 2018, 6:39 a.m. UTC | #1
On 04/03/2018 06:52 PM, Andy Whitcroft wrote:
> BugLink: http://bugs.launchpad.net/bugs/17608> Signed-off-by: Andy Whitcroft <apw@canonical.com>

Maybe at commit time add some text that is is (primarily) for DKMS.

Acked-by: Juerg Haefliger <juergh@canonical.com>


> ---
>  debian/rules                    | 6 +++++-
>  debian/rules.d/2-binary-arch.mk | 2 ++
>  scripts/Makefile.build          | 2 +-
>  3 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/debian/rules b/debian/rules
> index 2f3db8fca8c4..3b4b5c0d56b5 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -117,6 +117,9 @@ clean: debian/control
>  	# Install the copyright information.
>  	cp $(DEBIAN)/copyright debian/copyright
>  
> +	# Install the retpoline extractor.
> +	cp $(DROOT)/scripts/retpoline-extract-one scripts/ubuntu-retpoline-extract-one
> +
>  	# If we have a reconstruct script use it.
>  	[ -f $(DEBIAN)/reconstruct ] && bash $(DEBIAN)/reconstruct
>  
> @@ -126,7 +129,8 @@ clean: debian/control
>  
>  distclean: clean
>  	rm -rf $(DROOT)/control debian/changelog \
> -		debian/control debian/control.stub debian/copyright
> +		debian/control debian/control.stub debian/copyright \
> +		scripts/ubuntu-retpoline-extract-one
>  
>  # Builds the image, arch headers and debug packages
>  include $(DROOT)/rules.d/2-binary-arch.mk
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index d1127dec61e3..eab72d29b35e 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -325,6 +325,8 @@ ifeq ($(build_arch),powerpc)
>  	mkdir -p $(hdrdir)/arch/powerpc/lib
>  	cp $(builddir)/build-$*/arch/powerpc/lib/*.o $(hdrdir)/arch/powerpc/lib
>  endif
> +	# Copy over the new retpoline extractor.
> +	cp scripts/ubuntu-retpoline-extract-one $(hdrdir)/scripts
>  	# Script to symlink everything up
>  	$(SHELL) $(DROOT)/scripts/link-headers "$(hdrdir)" "$(indeppkg)" "$*"
>  	# The build symlink
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 7c4536a5fb66..5db9a0871f1f 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -244,7 +244,7 @@ cmd_record_mcount =						\
>  endif
>  
>  ifdef CONFIG_RETPOLINE
> -cmd_ubuntu_retpoline = $(CONFIG_SHELL) $(srctree)/debian/scripts/retpoline-extract-one $(@) $(<) "$(filter -m16 %code16gcc.h,$(a_flags))";
> +cmd_ubuntu_retpoline = $(CONFIG_SHELL) $(srctree)/scripts/ubuntu-retpoline-extract-one $(@) $(<) "$(filter -m16 %code16gcc.h,$(a_flags))";
>  else
>  cmd_ubuntu_retpoline =
>  endif
>
Stefan Bader April 4, 2018, 9:54 a.m. UTC | #2
On 03.04.2018 18:52, Andy Whitcroft wrote:
> BugLink: http://bugs.launchpad.net/bugs/1760876
> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>

> ---

Maybe a bit more explanation in the commit message?

>  debian/rules                    | 6 +++++-
>  debian/rules.d/2-binary-arch.mk | 2 ++
>  scripts/Makefile.build          | 2 +-
>  3 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/debian/rules b/debian/rules
> index 2f3db8fca8c4..3b4b5c0d56b5 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -117,6 +117,9 @@ clean: debian/control
>  	# Install the copyright information.
>  	cp $(DEBIAN)/copyright debian/copyright
>  
> +	# Install the retpoline extractor.
> +	cp $(DROOT)/scripts/retpoline-extract-one scripts/ubuntu-retpoline-extract-one
> +
>  	# If we have a reconstruct script use it.
>  	[ -f $(DEBIAN)/reconstruct ] && bash $(DEBIAN)/reconstruct
>  
> @@ -126,7 +129,8 @@ clean: debian/control
>  
>  distclean: clean
>  	rm -rf $(DROOT)/control debian/changelog \
> -		debian/control debian/control.stub debian/copyright
> +		debian/control debian/control.stub debian/copyright \
> +		scripts/ubuntu-retpoline-extract-one
>  
>  # Builds the image, arch headers and debug packages
>  include $(DROOT)/rules.d/2-binary-arch.mk
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index d1127dec61e3..eab72d29b35e 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -325,6 +325,8 @@ ifeq ($(build_arch),powerpc)
>  	mkdir -p $(hdrdir)/arch/powerpc/lib
>  	cp $(builddir)/build-$*/arch/powerpc/lib/*.o $(hdrdir)/arch/powerpc/lib
>  endif
> +	# Copy over the new retpoline extractor.
> +	cp scripts/ubuntu-retpoline-extract-one $(hdrdir)/scripts
>  	# Script to symlink everything up
>  	$(SHELL) $(DROOT)/scripts/link-headers "$(hdrdir)" "$(indeppkg)" "$*"
>  	# The build symlink
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 7c4536a5fb66..5db9a0871f1f 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -244,7 +244,7 @@ cmd_record_mcount =						\
>  endif
>  
>  ifdef CONFIG_RETPOLINE
> -cmd_ubuntu_retpoline = $(CONFIG_SHELL) $(srctree)/debian/scripts/retpoline-extract-one $(@) $(<) "$(filter -m16 %code16gcc.h,$(a_flags))";
> +cmd_ubuntu_retpoline = $(CONFIG_SHELL) $(srctree)/scripts/ubuntu-retpoline-extract-one $(@) $(<) "$(filter -m16 %code16gcc.h,$(a_flags))";
>  else
>  cmd_ubuntu_retpoline =
>  endif
>
Andy Whitcroft April 5, 2018, 7:55 a.m. UTC | #3
How about:

	Out of tree builds utilise the kernel Makefiles and therefore
	we need to include all direct dependencies of those Makefiles.
	Now that we call out to the repoline extractor during builds we
	must carry the extractor with the headers.  Move the extractor
	to the kernel scripts directory and ensure its name is unique.

-apw

On Wed, Apr 04, 2018 at 11:54:34AM +0200, Stefan Bader wrote:
> On 03.04.2018 18:52, Andy Whitcroft wrote:
> > BugLink: http://bugs.launchpad.net/bugs/1760876
> > Signed-off-by: Andy Whitcroft <apw@canonical.com>
> Acked-by: Stefan Bader <stefan.bader@canonical.com>
> 
> > ---
> 
> Maybe a bit more explanation in the commit message?
> 
> >  debian/rules                    | 6 +++++-
> >  debian/rules.d/2-binary-arch.mk | 2 ++
> >  scripts/Makefile.build          | 2 +-
> >  3 files changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/debian/rules b/debian/rules
> > index 2f3db8fca8c4..3b4b5c0d56b5 100755
> > --- a/debian/rules
> > +++ b/debian/rules
> > @@ -117,6 +117,9 @@ clean: debian/control
> >  	# Install the copyright information.
> >  	cp $(DEBIAN)/copyright debian/copyright
> >  
> > +	# Install the retpoline extractor.
> > +	cp $(DROOT)/scripts/retpoline-extract-one scripts/ubuntu-retpoline-extract-one
> > +
> >  	# If we have a reconstruct script use it.
> >  	[ -f $(DEBIAN)/reconstruct ] && bash $(DEBIAN)/reconstruct
> >  
> > @@ -126,7 +129,8 @@ clean: debian/control
> >  
> >  distclean: clean
> >  	rm -rf $(DROOT)/control debian/changelog \
> > -		debian/control debian/control.stub debian/copyright
> > +		debian/control debian/control.stub debian/copyright \
> > +		scripts/ubuntu-retpoline-extract-one
> >  
> >  # Builds the image, arch headers and debug packages
> >  include $(DROOT)/rules.d/2-binary-arch.mk
> > diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> > index d1127dec61e3..eab72d29b35e 100644
> > --- a/debian/rules.d/2-binary-arch.mk
> > +++ b/debian/rules.d/2-binary-arch.mk
> > @@ -325,6 +325,8 @@ ifeq ($(build_arch),powerpc)
> >  	mkdir -p $(hdrdir)/arch/powerpc/lib
> >  	cp $(builddir)/build-$*/arch/powerpc/lib/*.o $(hdrdir)/arch/powerpc/lib
> >  endif
> > +	# Copy over the new retpoline extractor.
> > +	cp scripts/ubuntu-retpoline-extract-one $(hdrdir)/scripts
> >  	# Script to symlink everything up
> >  	$(SHELL) $(DROOT)/scripts/link-headers "$(hdrdir)" "$(indeppkg)" "$*"
> >  	# The build symlink
> > diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> > index 7c4536a5fb66..5db9a0871f1f 100644
> > --- a/scripts/Makefile.build
> > +++ b/scripts/Makefile.build
> > @@ -244,7 +244,7 @@ cmd_record_mcount =						\
> >  endif
> >  
> >  ifdef CONFIG_RETPOLINE
> > -cmd_ubuntu_retpoline = $(CONFIG_SHELL) $(srctree)/debian/scripts/retpoline-extract-one $(@) $(<) "$(filter -m16 %code16gcc.h,$(a_flags))";
> > +cmd_ubuntu_retpoline = $(CONFIG_SHELL) $(srctree)/scripts/ubuntu-retpoline-extract-one $(@) $(<) "$(filter -m16 %code16gcc.h,$(a_flags))";
> >  else
> >  cmd_ubuntu_retpoline =
> >  endif
> > 
> 
> 




> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Kleber Sacilotto de Souza April 5, 2018, 8:07 a.m. UTC | #4
On 04/05/18 09:55, Andy Whitcroft wrote:
> How about:
> 
> 	Out of tree builds utilise the kernel Makefiles and therefore
> 	we need to include all direct dependencies of those Makefiles.
> 	Now that we call out to the repoline extractor during builds we
> 	must carry the extractor with the headers.  Move the extractor
> 	to the kernel scripts directory and ensure its name is unique.
> 
> -apw

Looks good to me, thanks Andy!

We can use the same description and fixup the commit message for all the
submitted series when applying the patches.

Kleber

> 
> On Wed, Apr 04, 2018 at 11:54:34AM +0200, Stefan Bader wrote:
>> On 03.04.2018 18:52, Andy Whitcroft wrote:
>>> BugLink: http://bugs.launchpad.net/bugs/1760876
>>> Signed-off-by: Andy Whitcroft <apw@canonical.com>
>> Acked-by: Stefan Bader <stefan.bader@canonical.com>
>>
>>> ---
>>
>> Maybe a bit more explanation in the commit message?
>>
>>>  debian/rules                    | 6 +++++-
>>>  debian/rules.d/2-binary-arch.mk | 2 ++
>>>  scripts/Makefile.build          | 2 +-
>>>  3 files changed, 8 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/debian/rules b/debian/rules
>>> index 2f3db8fca8c4..3b4b5c0d56b5 100755
>>> --- a/debian/rules
>>> +++ b/debian/rules
>>> @@ -117,6 +117,9 @@ clean: debian/control
>>>  	# Install the copyright information.
>>>  	cp $(DEBIAN)/copyright debian/copyright
>>>  
>>> +	# Install the retpoline extractor.
>>> +	cp $(DROOT)/scripts/retpoline-extract-one scripts/ubuntu-retpoline-extract-one
>>> +
>>>  	# If we have a reconstruct script use it.
>>>  	[ -f $(DEBIAN)/reconstruct ] && bash $(DEBIAN)/reconstruct
>>>  
>>> @@ -126,7 +129,8 @@ clean: debian/control
>>>  
>>>  distclean: clean
>>>  	rm -rf $(DROOT)/control debian/changelog \
>>> -		debian/control debian/control.stub debian/copyright
>>> +		debian/control debian/control.stub debian/copyright \
>>> +		scripts/ubuntu-retpoline-extract-one
>>>  
>>>  # Builds the image, arch headers and debug packages
>>>  include $(DROOT)/rules.d/2-binary-arch.mk
>>> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
>>> index d1127dec61e3..eab72d29b35e 100644
>>> --- a/debian/rules.d/2-binary-arch.mk
>>> +++ b/debian/rules.d/2-binary-arch.mk
>>> @@ -325,6 +325,8 @@ ifeq ($(build_arch),powerpc)
>>>  	mkdir -p $(hdrdir)/arch/powerpc/lib
>>>  	cp $(builddir)/build-$*/arch/powerpc/lib/*.o $(hdrdir)/arch/powerpc/lib
>>>  endif
>>> +	# Copy over the new retpoline extractor.
>>> +	cp scripts/ubuntu-retpoline-extract-one $(hdrdir)/scripts
>>>  	# Script to symlink everything up
>>>  	$(SHELL) $(DROOT)/scripts/link-headers "$(hdrdir)" "$(indeppkg)" "$*"
>>>  	# The build symlink
>>> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
>>> index 7c4536a5fb66..5db9a0871f1f 100644
>>> --- a/scripts/Makefile.build
>>> +++ b/scripts/Makefile.build
>>> @@ -244,7 +244,7 @@ cmd_record_mcount =						\
>>>  endif
>>>  
>>>  ifdef CONFIG_RETPOLINE
>>> -cmd_ubuntu_retpoline = $(CONFIG_SHELL) $(srctree)/debian/scripts/retpoline-extract-one $(@) $(<) "$(filter -m16 %code16gcc.h,$(a_flags))";
>>> +cmd_ubuntu_retpoline = $(CONFIG_SHELL) $(srctree)/scripts/ubuntu-retpoline-extract-one $(@) $(<) "$(filter -m16 %code16gcc.h,$(a_flags))";
>>>  else
>>>  cmd_ubuntu_retpoline =
>>>  endif
>>>
>>
>>
> 
> 
> 
> 
>> -- 
>> kernel-team mailing list
>> kernel-team@lists.ubuntu.com
>> https://lists.ubuntu.com/mailman/listinfo/kernel-team
> 
>
Kleber Sacilotto de Souza April 5, 2018, 8:22 a.m. UTC | #5
On 04/03/18 18:52, Andy Whitcroft wrote:
> BugLink: http://bugs.launchpad.net/bugs/1760876
> Signed-off-by: Andy Whitcroft <apw@canonical.com>
> ---
>  debian/rules                    | 6 +++++-
>  debian/rules.d/2-binary-arch.mk | 2 ++
>  scripts/Makefile.build          | 2 +-
>  3 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/debian/rules b/debian/rules
> index 2f3db8fca8c4..3b4b5c0d56b5 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -117,6 +117,9 @@ clean: debian/control
>  	# Install the copyright information.
>  	cp $(DEBIAN)/copyright debian/copyright
>  
> +	# Install the retpoline extractor.
> +	cp $(DROOT)/scripts/retpoline-extract-one scripts/ubuntu-retpoline-extract-one
> +
>  	# If we have a reconstruct script use it.
>  	[ -f $(DEBIAN)/reconstruct ] && bash $(DEBIAN)/reconstruct
>  
> @@ -126,7 +129,8 @@ clean: debian/control
>  
>  distclean: clean
>  	rm -rf $(DROOT)/control debian/changelog \
> -		debian/control debian/control.stub debian/copyright
> +		debian/control debian/control.stub debian/copyright \
> +		scripts/ubuntu-retpoline-extract-one
>  
>  # Builds the image, arch headers and debug packages
>  include $(DROOT)/rules.d/2-binary-arch.mk
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index d1127dec61e3..eab72d29b35e 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -325,6 +325,8 @@ ifeq ($(build_arch),powerpc)
>  	mkdir -p $(hdrdir)/arch/powerpc/lib
>  	cp $(builddir)/build-$*/arch/powerpc/lib/*.o $(hdrdir)/arch/powerpc/lib
>  endif
> +	# Copy over the new retpoline extractor.
> +	cp scripts/ubuntu-retpoline-extract-one $(hdrdir)/scripts
>  	# Script to symlink everything up
>  	$(SHELL) $(DROOT)/scripts/link-headers "$(hdrdir)" "$(indeppkg)" "$*"
>  	# The build symlink
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 7c4536a5fb66..5db9a0871f1f 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -244,7 +244,7 @@ cmd_record_mcount =						\
>  endif
>  
>  ifdef CONFIG_RETPOLINE
> -cmd_ubuntu_retpoline = $(CONFIG_SHELL) $(srctree)/debian/scripts/retpoline-extract-one $(@) $(<) "$(filter -m16 %code16gcc.h,$(a_flags))";
> +cmd_ubuntu_retpoline = $(CONFIG_SHELL) $(srctree)/scripts/ubuntu-retpoline-extract-one $(@) $(<) "$(filter -m16 %code16gcc.h,$(a_flags))";
>  else
>  cmd_ubuntu_retpoline =
>  endif
> 

Applied to xenial/master-next branch, with the commit message fixup.

Thanks,
Kleber
diff mbox series

Patch

diff --git a/debian/rules b/debian/rules
index 2f3db8fca8c4..3b4b5c0d56b5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -117,6 +117,9 @@  clean: debian/control
 	# Install the copyright information.
 	cp $(DEBIAN)/copyright debian/copyright
 
+	# Install the retpoline extractor.
+	cp $(DROOT)/scripts/retpoline-extract-one scripts/ubuntu-retpoline-extract-one
+
 	# If we have a reconstruct script use it.
 	[ -f $(DEBIAN)/reconstruct ] && bash $(DEBIAN)/reconstruct
 
@@ -126,7 +129,8 @@  clean: debian/control
 
 distclean: clean
 	rm -rf $(DROOT)/control debian/changelog \
-		debian/control debian/control.stub debian/copyright
+		debian/control debian/control.stub debian/copyright \
+		scripts/ubuntu-retpoline-extract-one
 
 # Builds the image, arch headers and debug packages
 include $(DROOT)/rules.d/2-binary-arch.mk
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index d1127dec61e3..eab72d29b35e 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -325,6 +325,8 @@  ifeq ($(build_arch),powerpc)
 	mkdir -p $(hdrdir)/arch/powerpc/lib
 	cp $(builddir)/build-$*/arch/powerpc/lib/*.o $(hdrdir)/arch/powerpc/lib
 endif
+	# Copy over the new retpoline extractor.
+	cp scripts/ubuntu-retpoline-extract-one $(hdrdir)/scripts
 	# Script to symlink everything up
 	$(SHELL) $(DROOT)/scripts/link-headers "$(hdrdir)" "$(indeppkg)" "$*"
 	# The build symlink
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 7c4536a5fb66..5db9a0871f1f 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -244,7 +244,7 @@  cmd_record_mcount =						\
 endif
 
 ifdef CONFIG_RETPOLINE
-cmd_ubuntu_retpoline = $(CONFIG_SHELL) $(srctree)/debian/scripts/retpoline-extract-one $(@) $(<) "$(filter -m16 %code16gcc.h,$(a_flags))";
+cmd_ubuntu_retpoline = $(CONFIG_SHELL) $(srctree)/scripts/ubuntu-retpoline-extract-one $(@) $(<) "$(filter -m16 %code16gcc.h,$(a_flags))";
 else
 cmd_ubuntu_retpoline =
 endif