Message ID | 20200710135008.9085-1-JPEWhacker@gmail.com |
---|---|
State | Changes Requested |
Headers | show |
Series | [meta-swupdate] swupdate: Set build flags | expand |
Ping? On 7/10/20 8:50 AM, Joshua Watt wrote: > Sets the recipe build flags in the default configuration file. This > ensures that swupdate is correctly compiled with the flags that are set > by build, for example ensuring that debug symbols are present. > > Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> > --- > recipes-support/swupdate/swupdate.inc | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc > index b65fb86..750b942 100644 > --- a/recipes-support/swupdate/swupdate.inc > +++ b/recipes-support/swupdate/swupdate.inc > @@ -192,6 +192,12 @@ python () { > > do_configure () { > cp ${WORKDIR}/defconfig ${WORKDIR}/.config > + > + cat >> ${WORKDIR}/.config <<HEREDOC > +CONFIG_EXTRA_CFLAGS="${CFLAGS}" > +CONFIG_EXTRA_LDFLAGS="${LDFLAGS}" > +HEREDOC > + > merge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" ".join(find_cfgs(d))} > (cd ${S} && cml1_do_configure) > }
Hi Joshua, On 17.07.20 15:39, Joshua Watt wrote: > Ping? > > On 7/10/20 8:50 AM, Joshua Watt wrote: >> Sets the recipe build flags in the default configuration file. This >> ensures that swupdate is correctly compiled with the flags that are set >> by build, for example ensuring that debug symbols are present. >> >> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> >> --- >> recipes-support/swupdate/swupdate.inc | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/recipes-support/swupdate/swupdate.inc >> b/recipes-support/swupdate/swupdate.inc >> index b65fb86..750b942 100644 >> --- a/recipes-support/swupdate/swupdate.inc >> +++ b/recipes-support/swupdate/swupdate.inc >> @@ -192,6 +192,12 @@ python () { >> do_configure () { >> cp ${WORKDIR}/defconfig ${WORKDIR}/.config >> + >> + cat >> ${WORKDIR}/.config <<HEREDOC >> +CONFIG_EXTRA_CFLAGS="${CFLAGS}" >> +CONFIG_EXTRA_LDFLAGS="${LDFLAGS}" >> +HEREDOC >> + >> m I do not understand why we need them. CONFIG_EXTRA_CFLAGS and CONFIG_EXTRA_LDFLAGS are as all other CONFIG_, and they are set if defconfig or fragments contain them. Why do we need them ? erge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" >> ".join(find_cfgs(d))} >> (cd ${S} && cml1_do_configure) >> } > Best regards, Stefano
On 7/17/20 12:28 PM, Stefano Babic wrote: > Hi Joshua, > > On 17.07.20 15:39, Joshua Watt wrote: >> Ping? >> >> On 7/10/20 8:50 AM, Joshua Watt wrote: >>> Sets the recipe build flags in the default configuration file. This >>> ensures that swupdate is correctly compiled with the flags that are set >>> by build, for example ensuring that debug symbols are present. >>> >>> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> >>> --- >>> recipes-support/swupdate/swupdate.inc | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git a/recipes-support/swupdate/swupdate.inc >>> b/recipes-support/swupdate/swupdate.inc >>> index b65fb86..750b942 100644 >>> --- a/recipes-support/swupdate/swupdate.inc >>> +++ b/recipes-support/swupdate/swupdate.inc >>> @@ -192,6 +192,12 @@ python () { >>> do_configure () { >>> cp ${WORKDIR}/defconfig ${WORKDIR}/.config >>> + >>> + cat >> ${WORKDIR}/.config <<HEREDOC >>> +CONFIG_EXTRA_CFLAGS="${CFLAGS}" >>> +CONFIG_EXTRA_LDFLAGS="${LDFLAGS}" >>> +HEREDOC >>> + >>> m > I do not understand why we need them. CONFIG_EXTRA_CFLAGS and > CONFIG_EXTRA_LDFLAGS are as all other CONFIG_, and they are set if > defconfig or fragments contain them. Why do we need them ? This makes it follow the same rules as other recipes with respect to debugging flags and such. I found this because I was attempting to debug a crash in swupdate but the symbols were unexpectedly missing from the -dbg package because these flags were not passed along. There are also a lot of other flags besides "-g" that are passed in CFLAGS that most users want to be respected, such as prefix mapping for reproducible builds. It would seem a little strange to me to have to specify that sort of thing independently in swupdate when all other recipes behave the same, and there's no feasible way to get the same behavior as the CFLAGS provided by bitbake with a static assignment because many of them are based on the build path or other information only known to the recipe. Even so, if you still want that behavior, I can prepend the flags to defconfig so that if the user really wants to override them for some reason in defconfig or a config fragment they can. > > > > erge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" >>> ".join(find_cfgs(d))} >>> (cd ${S} && cml1_do_configure) >>> } > Best regards, > Stefano >
Hi Joshua, On 17.07.20 19:38, Joshua Watt wrote: > > On 7/17/20 12:28 PM, Stefano Babic wrote: >> Hi Joshua, >> >> On 17.07.20 15:39, Joshua Watt wrote: >>> Ping? >>> >>> On 7/10/20 8:50 AM, Joshua Watt wrote: >>>> Sets the recipe build flags in the default configuration file. This >>>> ensures that swupdate is correctly compiled with the flags that are set >>>> by build, for example ensuring that debug symbols are present. >>>> >>>> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> >>>> --- >>>> recipes-support/swupdate/swupdate.inc | 6 ++++++ >>>> 1 file changed, 6 insertions(+) >>>> >>>> diff --git a/recipes-support/swupdate/swupdate.inc >>>> b/recipes-support/swupdate/swupdate.inc >>>> index b65fb86..750b942 100644 >>>> --- a/recipes-support/swupdate/swupdate.inc >>>> +++ b/recipes-support/swupdate/swupdate.inc >>>> @@ -192,6 +192,12 @@ python () { >>>> do_configure () { >>>> cp ${WORKDIR}/defconfig ${WORKDIR}/.config >>>> + >>>> + cat >> ${WORKDIR}/.config <<HEREDOC >>>> +CONFIG_EXTRA_CFLAGS="${CFLAGS}" >>>> +CONFIG_EXTRA_LDFLAGS="${LDFLAGS}" >>>> +HEREDOC >>>> + >>>> m >> I do not understand why we need them. CONFIG_EXTRA_CFLAGS and >> CONFIG_EXTRA_LDFLAGS are as all other CONFIG_, and they are set if >> defconfig or fragments contain them. Why do we need them ? > > This makes it follow the same rules as other recipes with respect to > debugging flags and such. Even busybox ? One thing is that OE is one of the buildsystems, not the one. On OE it makes more sense to let EXTRA_CFLAGS out, but I am not sure when it is built for other systems. > I found this because I was attempting to debug > a crash in swupdate but the symbols were unexpectedly missing from the > -dbg package because these flags were not passed along. Yes, reason is clear to me. > There are also a > lot of other flags besides "-g" that are passed in CFLAGS that most > users want to be respected, such as prefix mapping for reproducible builds. > > > It would seem a little strange to me to have to specify that sort of > thing independently in swupdate when all other recipes behave the same, > and there's no feasible way to get the same behavior as the CFLAGS > provided by bitbake with a static assignment because many of them are > based on the build path or other information only known to the recipe. But then, we cannot have both way to set the flags. If we rely on flags passed by OE, EXTRA_CFLAGS should be dropped by CONFIG_, right ? > Even so, if you still want that behavior, I can prepend the flags to > defconfig so that if the user really wants to override them for some > reason in defconfig or a config fragment they can. It sounds weird - if someone wants to overwrite them, he should do this in a own .bbappend (for example, as EXTRA_OEMAKE). We can safe drop the use case with CFLAGS in defconfig. Best regards, Stefano > > >> >> >> >> erge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" >>>> ".join(find_cfgs(d))} >>>> (cd ${S} && cml1_do_configure) >>>> } >> Best regards, >> Stefano >> >
diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc index b65fb86..750b942 100644 --- a/recipes-support/swupdate/swupdate.inc +++ b/recipes-support/swupdate/swupdate.inc @@ -192,6 +192,12 @@ python () { do_configure () { cp ${WORKDIR}/defconfig ${WORKDIR}/.config + + cat >> ${WORKDIR}/.config <<HEREDOC +CONFIG_EXTRA_CFLAGS="${CFLAGS}" +CONFIG_EXTRA_LDFLAGS="${LDFLAGS}" +HEREDOC + merge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" ".join(find_cfgs(d))} (cd ${S} && cml1_do_configure) }
Sets the recipe build flags in the default configuration file. This ensures that swupdate is correctly compiled with the flags that are set by build, for example ensuring that debug symbols are present. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> --- recipes-support/swupdate/swupdate.inc | 6 ++++++ 1 file changed, 6 insertions(+)