failing to build in launchpad upload environment

Submitted by Cyrill Gorcunov on June 30, 2016, 3:08 p.m.

Details

Message ID 20160630150820.GF4666@uranus
State Rejected
Series "failing to build in launchpad upload environment"
Headers show

Commit Message

Cyrill Gorcunov June 30, 2016, 3:08 p.m.
On Thu, Jun 30, 2016 at 08:08:55AM -0600, Tycho Andersen wrote:
> 
> Well, we'd like to avoid any build-script specific hacks to keep in
> line with debian.
> 
> The build system passes its own LDFLAGS, but it passes them with the
> gcc wrappers "-Wl". The problem is that CRIU's makefiles use ld
> directly, and don't invoke it through gcc, and ld doesn't recognize
> the -Wl bits.
> 
> I'm not sure how/why this works in the debian builds, because
> presumably they're passing the same flags. Perhaps Salvatore can
> elaborate?

Could you give the patch a shot?
---

Patch hide | download patch | download mbox

diff --git a/scripts/nmk/scripts/build.mk b/scripts/nmk/scripts/build.mk
index bd409441293e..cee9a93c53b2 100644
--- a/scripts/nmk/scripts/build.mk
+++ b/scripts/nmk/scripts/build.mk
@@ -25,6 +25,13 @@  ifndef obj
 endif
 
 #
+# Filter out any -Wl,XXX option: some of build farms
+# assumes that we're using $(CC) for building built-in
+# targets.
+LDFLAGS-MASK	:= -Wl,%
+LDFLAGS		:= $(filter-out $(LDFLAGS-MASK),$(LDFLAGS))
+
+#
 # Accumulate common flags.
 define nmk-ccflags
         $(CFLAGS) $(ccflags-y) $(CFLAGS_$(@F))

Comments

Tycho Andersen June 30, 2016, 3:18 p.m.
On Thu, Jun 30, 2016 at 06:08:20PM +0300, Cyrill Gorcunov wrote:
> On Thu, Jun 30, 2016 at 08:08:55AM -0600, Tycho Andersen wrote:
> > 
> > Well, we'd like to avoid any build-script specific hacks to keep in
> > line with debian.
> > 
> > The build system passes its own LDFLAGS, but it passes them with the
> > gcc wrappers "-Wl". The problem is that CRIU's makefiles use ld
> > directly, and don't invoke it through gcc, and ld doesn't recognize
> > the -Wl bits.
> > 
> > I'm not sure how/why this works in the debian builds, because
> > presumably they're passing the same flags. Perhaps Salvatore can
> > elaborate?
> 
> Could you give the patch a shot?

Yep, works for me,

Tested-by: Tycho Andersen <tycho.andersen@canonical.com>

> ---
> diff --git a/scripts/nmk/scripts/build.mk b/scripts/nmk/scripts/build.mk
> index bd409441293e..cee9a93c53b2 100644
> --- a/scripts/nmk/scripts/build.mk
> +++ b/scripts/nmk/scripts/build.mk
> @@ -25,6 +25,13 @@ ifndef obj
>  endif
>  
>  #
> +# Filter out any -Wl,XXX option: some of build farms
> +# assumes that we're using $(CC) for building built-in
> +# targets.
> +LDFLAGS-MASK	:= -Wl,%
> +LDFLAGS		:= $(filter-out $(LDFLAGS-MASK),$(LDFLAGS))
> +
> +#
>  # Accumulate common flags.
>  define nmk-ccflags
>          $(CFLAGS) $(ccflags-y) $(CFLAGS_$(@F))
Cyrill Gorcunov June 30, 2016, 3:26 p.m.
On Thu, Jun 30, 2016 at 09:18:44AM -0600, Tycho Andersen wrote:
> On Thu, Jun 30, 2016 at 06:08:20PM +0300, Cyrill Gorcunov wrote:
> > On Thu, Jun 30, 2016 at 08:08:55AM -0600, Tycho Andersen wrote:
> > > 
> > > Well, we'd like to avoid any build-script specific hacks to keep in
> > > line with debian.
> > > 
> > > The build system passes its own LDFLAGS, but it passes them with the
> > > gcc wrappers "-Wl". The problem is that CRIU's makefiles use ld
> > > directly, and don't invoke it through gcc, and ld doesn't recognize
> > > the -Wl bits.
> > > 
> > > I'm not sure how/why this works in the debian builds, because
> > > presumably they're passing the same flags. Perhaps Salvatore can
> > > elaborate?
> > 
> > Could you give the patch a shot?
> 
> Yep, works for me,
> 
> Tested-by: Tycho Andersen <tycho.andersen@canonical.com>

I believe we can merge such thing. I'll prepare complete
patch and resend. Thanks!

> 
> > ---
> > diff --git a/scripts/nmk/scripts/build.mk b/scripts/nmk/scripts/build.mk
> > index bd409441293e..cee9a93c53b2 100644
> > --- a/scripts/nmk/scripts/build.mk
> > +++ b/scripts/nmk/scripts/build.mk
> > @@ -25,6 +25,13 @@ ifndef obj
> >  endif
> >  
> >  #
> > +# Filter out any -Wl,XXX option: some of build farms
> > +# assumes that we're using $(CC) for building built-in
> > +# targets.
> > +LDFLAGS-MASK	:= -Wl,%
> > +LDFLAGS		:= $(filter-out $(LDFLAGS-MASK),$(LDFLAGS))
> > +
> > +#
> >  # Accumulate common flags.
> >  define nmk-ccflags
> >          $(CFLAGS) $(ccflags-y) $(CFLAGS_$(@F))
> 

	Cyrill
Salvatore Bonaccorso June 30, 2016, 3:31 p.m.
Hi

Sorry for not replying earlier, busy.

On Thu, Jun 30, 2016 at 09:18:44AM -0600, Tycho Andersen wrote:
> On Thu, Jun 30, 2016 at 06:08:20PM +0300, Cyrill Gorcunov wrote:
> > On Thu, Jun 30, 2016 at 08:08:55AM -0600, Tycho Andersen wrote:
> > > 
> > > Well, we'd like to avoid any build-script specific hacks to keep in
> > > line with debian.
> > > 
> > > The build system passes its own LDFLAGS, but it passes them with the
> > > gcc wrappers "-Wl". The problem is that CRIU's makefiles use ld
> > > directly, and don't invoke it through gcc, and ld doesn't recognize
> > > the -Wl bits.
> > > 
> > > I'm not sure how/why this works in the debian builds, because
> > > presumably they're passing the same flags. Perhaps Salvatore can
> > > elaborate?
> > 
> > Could you give the patch a shot?
> 
> Yep, works for me,

I applied the patch on top of 2.3-2 currently in unstable and
building, and looks good.

Salvatore
Tycho Andersen June 30, 2016, 3:33 p.m.
Hi,

On Thu, Jun 30, 2016 at 05:31:02PM +0200, Salvatore Bonaccorso wrote:
> Hi
> 
> Sorry for not replying earlier, busy.

No problem!

> On Thu, Jun 30, 2016 at 09:18:44AM -0600, Tycho Andersen wrote:
> > On Thu, Jun 30, 2016 at 06:08:20PM +0300, Cyrill Gorcunov wrote:
> > > On Thu, Jun 30, 2016 at 08:08:55AM -0600, Tycho Andersen wrote:
> > > > 
> > > > Well, we'd like to avoid any build-script specific hacks to keep in
> > > > line with debian.
> > > > 
> > > > The build system passes its own LDFLAGS, but it passes them with the
> > > > gcc wrappers "-Wl". The problem is that CRIU's makefiles use ld
> > > > directly, and don't invoke it through gcc, and ld doesn't recognize
> > > > the -Wl bits.
> > > > 
> > > > I'm not sure how/why this works in the debian builds, because
> > > > presumably they're passing the same flags. Perhaps Salvatore can
> > > > elaborate?
> > > 
> > > Could you give the patch a shot?
> > 
> > Yep, works for me,
> 
> I applied the patch on top of 2.3-2 currently in unstable and
> building, and looks good.

Thanks, I'll get our team to sync it once it is in unstable to confirm
that it works, and then we can go back to taking debian packages
directly.

Tycho