* HOST_* flags are not used by gnulib
@ 2014-04-03 18:01 Andrey Borzenkov
2014-07-23 7:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 10+ messages in thread
From: Andrey Borzenkov @ 2014-04-03 18:01 UTC (permalink / raw)
To: grub-devel
I noticed that host flags are not propagated to gnulib. This does not
feel right; in particular I noticed it because attempt to enable
debugging for host tools (HOST_CFLAGS=-g) did not work for gnulib files.
Is it intentional?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: HOST_* flags are not used by gnulib
2014-04-03 18:01 HOST_* flags are not used by gnulib Andrey Borzenkov
@ 2014-07-23 7:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-07-27 18:06 ` Mike Gilbert
2014-07-28 2:52 ` Andrey Borzenkov
0 siblings, 2 replies; 10+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-07-23 7:41 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 499 bytes --]
On 03.04.2014 20:01, Andrey Borzenkov wrote:
> I noticed that host flags are not propagated to gnulib. This does not
> feel right; in particular I noticed it because attempt to enable
> debugging for host tools (HOST_CFLAGS=-g) did not work for gnulib files.
>
It should be just CFLAGS (refer to INSTALL)
> Is it intentional?
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: HOST_* flags are not used by gnulib
2014-07-23 7:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2014-07-27 18:06 ` Mike Gilbert
2014-07-27 18:10 ` Vladimir 'phcoder' Serbinenko
2014-07-28 2:52 ` Andrey Borzenkov
1 sibling, 1 reply; 10+ messages in thread
From: Mike Gilbert @ 2014-07-27 18:06 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Jul 23, 2014 at 3:41 AM, Vladimir 'φ-coder/phcoder' Serbinenko
<phcoder@gmail.com> wrote:
> On 03.04.2014 20:01, Andrey Borzenkov wrote:
>> I noticed that host flags are not propagated to gnulib. This does not
>> feel right; in particular I noticed it because attempt to enable
>> debugging for host tools (HOST_CFLAGS=-g) did not work for gnulib files.
>>
> It should be just CFLAGS (refer to INSTALL)
Last I checked, CFLAGS ends up getting used for both host utilities
and at least some of the target/boot code. That might be a bug in the
build system.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: HOST_* flags are not used by gnulib
2014-07-27 18:06 ` Mike Gilbert
@ 2014-07-27 18:10 ` Vladimir 'phcoder' Serbinenko
2014-07-27 18:24 ` Mike Gilbert
0 siblings, 1 reply; 10+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2014-07-27 18:10 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 961 bytes --]
On 27 Jul 2014 20:07, "Mike Gilbert" <floppym@gentoo.org> wrote:
>
> On Wed, Jul 23, 2014 at 3:41 AM, Vladimir 'φ-coder/phcoder' Serbinenko
> <phcoder@gmail.com> wrote:
> > On 03.04.2014 20:01, Andrey Borzenkov wrote:
> >> I noticed that host flags are not propagated to gnulib. This does not
> >> feel right; in particular I noticed it because attempt to enable
> >> debugging for host tools (HOST_CFLAGS=-g) did not work for gnulib
files.
> >>
> > It should be just CFLAGS (refer to INSTALL)
>
> Last I checked, CFLAGS ends up getting used for both host utilities
> and at least some of the target/boot code. That might be a bug in the
> build system.
>
>
CFLAGS is used as default for TARGET_CFLAGS. If it happens in another
context it's most likely a bug. Can you provide more details?
_______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
[-- Attachment #2: Type: text/html, Size: 1364 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: HOST_* flags are not used by gnulib
2014-07-27 18:10 ` Vladimir 'phcoder' Serbinenko
@ 2014-07-27 18:24 ` Mike Gilbert
2014-07-27 18:39 ` Andrey Borzenkov
0 siblings, 1 reply; 10+ messages in thread
From: Mike Gilbert @ 2014-07-27 18:24 UTC (permalink / raw)
To: The development of GNU GRUB
On Sun, Jul 27, 2014 at 2:10 PM, Vladimir 'phcoder' Serbinenko
<phcoder@gmail.com> wrote:
>
> On 27 Jul 2014 20:07, "Mike Gilbert" <floppym@gentoo.org> wrote:
>>
>> On Wed, Jul 23, 2014 at 3:41 AM, Vladimir 'φ-coder/phcoder' Serbinenko
>> <phcoder@gmail.com> wrote:
>> > On 03.04.2014 20:01, Andrey Borzenkov wrote:
>> >> I noticed that host flags are not propagated to gnulib. This does not
>> >> feel right; in particular I noticed it because attempt to enable
>> >> debugging for host tools (HOST_CFLAGS=-g) did not work for gnulib
>> >> files.
>> >>
>> > It should be just CFLAGS (refer to INSTALL)
>>
>> Last I checked, CFLAGS ends up getting used for both host utilities
>> and at least some of the target/boot code. That might be a bug in the
>> build system.
>>
>>
> CFLAGS is used as default for TARGET_CFLAGS. If it happens in another
> context it's most likely a bug. Can you provide more details?
Sure. If I configure with this script:
#!/bin/sh
CHOST=x86_64-pc-linux-gnu
CBUILD=$CHOST
CTARGET=armv7a-hardfloat-linux-gnueabi
S="${HOME}"/src/grub
# This will cause a build failure if passed to armv7a compiler
export CFLAGS="-march=x86-64"
export TARGET_CFLAGS="-Os"
"${S}"/configure --build="${CBUILD}" --host="${CHOST}" --target="${CTARGET}"
I get this build failure:
armv7a-hardfloat-linux-gnueabi-gcc -DHAVE_CONFIG_H -I.
-I/home/floppym/src/grub/grub-core -I.. -Wall -W
-I/home/floppym/src/grub/include -I../include -DGRUB_MACHINE_UBOOT=1
-DGRUB_MACHINE=ARM_UBOOT -nostdinc -isystem
/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.8.3/include
-DGRUB_FILE=\"lib/disk.c\" -I. -I/home/floppym/src/grub/grub-core -I..
-I/home/floppym/src/grub -I/home/floppym/src/grub/include -I../include
-I/home/floppym/src/grub/grub-core/lib/libgcrypt-grub/src/ -Os
-Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment
-Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero
-Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k
-Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain
-Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses
-Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch
-Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function
-Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable
-Wwrite-strings -Wnested-externs -Wstrict-prototypes -g
-Wredundant-decls -Wmissing-prototypes -Wmissing-declarations
-Wcast-align -Wextra -Wattributes -Wendif-labels -Winit-self
-Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers
-Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing
-Wvariadic-macros -Wvolatile-register-var -Wpointer-sign
-Wmissing-prototypes -Wmissing-declarations -Wformat=2
-freg-struct-return -fno-dwarf2-cfi-asm
-fno-asynchronous-unwind-tables -mlong-calls -mthumb-interwork -Qn
-fno-stack-protector -mno-unaligned-access -Wtrampolines -Werror
-ffreestanding -march=x86-64 -MT lib/disk_module-disk.o -MD -MP -MF
lib/.deps-core/disk_module-disk.Tpo -c -o lib/disk_module-disk.o `test
-f 'lib/disk.c' || echo '/home/floppym/src/grub/grub-core/'`lib/disk.c
armv7a-hardfloat-linux-gnueabi-gcc: error: unrecognized argument in
option ‘-march=x86-64’
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: HOST_* flags are not used by gnulib
2014-07-27 18:24 ` Mike Gilbert
@ 2014-07-27 18:39 ` Andrey Borzenkov
2014-07-27 18:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 10+ messages in thread
From: Andrey Borzenkov @ 2014-07-27 18:39 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: floppym
В Sun, 27 Jul 2014 14:24:07 -0400
Mike Gilbert <floppym@gentoo.org> пишет:
> On Sun, Jul 27, 2014 at 2:10 PM, Vladimir 'phcoder' Serbinenko
> <phcoder@gmail.com> wrote:
> >
> > On 27 Jul 2014 20:07, "Mike Gilbert" <floppym@gentoo.org> wrote:
> >>
> >> On Wed, Jul 23, 2014 at 3:41 AM, Vladimir 'φ-coder/phcoder' Serbinenko
> >> <phcoder@gmail.com> wrote:
> >> > On 03.04.2014 20:01, Andrey Borzenkov wrote:
> >> >> I noticed that host flags are not propagated to gnulib. This does not
> >> >> feel right; in particular I noticed it because attempt to enable
> >> >> debugging for host tools (HOST_CFLAGS=-g) did not work for gnulib
> >> >> files.
> >> >>
> >> > It should be just CFLAGS (refer to INSTALL)
> >>
> >> Last I checked, CFLAGS ends up getting used for both host utilities
> >> and at least some of the target/boot code. That might be a bug in the
> >> build system.
> >>
> >>
> > CFLAGS is used as default for TARGET_CFLAGS. If it happens in another
> > context it's most likely a bug. Can you provide more details?
>
> Sure. If I configure with this script:
>
> #!/bin/sh
> CHOST=x86_64-pc-linux-gnu
> CBUILD=$CHOST
> CTARGET=armv7a-hardfloat-linux-gnueabi
> S="${HOME}"/src/grub
>
> # This will cause a build failure if passed to armv7a compiler
> export CFLAGS="-march=x86-64"
> export TARGET_CFLAGS="-Os"
>
> "${S}"/configure --build="${CBUILD}" --host="${CHOST}" --target="${CTARGET}"
>
>
> I get this build failure:
>
> armv7a-hardfloat-linux-gnueabi-gcc -DHAVE_CONFIG_H -I.
> -I/home/floppym/src/grub/grub-core -I.. -Wall -W
> -I/home/floppym/src/grub/include -I../include -DGRUB_MACHINE_UBOOT=1
> -DGRUB_MACHINE=ARM_UBOOT -nostdinc -isystem
> /usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.8.3/include
> -DGRUB_FILE=\"lib/disk.c\" -I. -I/home/floppym/src/grub/grub-core -I..
> -I/home/floppym/src/grub -I/home/floppym/src/grub/include -I../include
> -I/home/floppym/src/grub/grub-core/lib/libgcrypt-grub/src/ -Os
> -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment
> -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero
> -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k
> -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain
> -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses
> -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch
> -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function
> -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable
> -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g
> -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations
> -Wcast-align -Wextra -Wattributes -Wendif-labels -Winit-self
> -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers
> -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing
> -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign
> -Wmissing-prototypes -Wmissing-declarations -Wformat=2
> -freg-struct-return -fno-dwarf2-cfi-asm
> -fno-asynchronous-unwind-tables -mlong-calls -mthumb-interwork -Qn
> -fno-stack-protector -mno-unaligned-access -Wtrampolines -Werror
> -ffreestanding -march=x86-64 -MT lib/disk_module-disk.o -MD -MP -MF
This is Automake generated rule for dependency tracking. It adds
$(CFLAGS) indeed. Not sure how we can work around it.
./Makefile: $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(grub_syslinux2cfg_CPPFLAGS) $(CPPFLAGS) $(grub_syslinux2cfg_CFLAGS) $(CFLAGS) -MT grub-core/kern/emu/grub_syslinux2cfg-hostfs.o -MD -MP -MF grub-core/kern/emu/$(DEPDIR)/grub_syslinux2cfg-hostfs.Tpo -c -o grub-core/kern/emu/grub_syslinux2cfg-hostfs.o `test -f 'grub-core/kern/emu/hostfs.c' || echo '$(srcdir)/'`grub-core/kern/emu/hostfs.c
For now I'm afraid the only workaround is "do not do it" - any stray
C(PP)FLAGS during make run will confuse it ... :(
> lib/.deps-core/disk_module-disk.Tpo -c -o lib/disk_module-disk.o `test
> -f 'lib/disk.c' || echo '/home/floppym/src/grub/grub-core/'`lib/disk.c
> armv7a-hardfloat-linux-gnueabi-gcc: error: unrecognized argument in
> option ‘-march=x86-64’
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: HOST_* flags are not used by gnulib
2014-07-27 18:39 ` Andrey Borzenkov
@ 2014-07-27 18:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-07-27 18:48 ` Andrey Borzenkov
0 siblings, 1 reply; 10+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-07-27 18:42 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 4700 bytes --]
On 27.07.2014 20:39, Andrey Borzenkov wrote:
> В Sun, 27 Jul 2014 14:24:07 -0400
> Mike Gilbert <floppym@gentoo.org> пишет:
>
>> On Sun, Jul 27, 2014 at 2:10 PM, Vladimir 'phcoder' Serbinenko
>> <phcoder@gmail.com> wrote:
>>>
>>> On 27 Jul 2014 20:07, "Mike Gilbert" <floppym@gentoo.org> wrote:
>>>>
>>>> On Wed, Jul 23, 2014 at 3:41 AM, Vladimir 'φ-coder/phcoder' Serbinenko
>>>> <phcoder@gmail.com> wrote:
>>>>> On 03.04.2014 20:01, Andrey Borzenkov wrote:
>>>>>> I noticed that host flags are not propagated to gnulib. This does not
>>>>>> feel right; in particular I noticed it because attempt to enable
>>>>>> debugging for host tools (HOST_CFLAGS=-g) did not work for gnulib
>>>>>> files.
>>>>>>
>>>>> It should be just CFLAGS (refer to INSTALL)
>>>>
>>>> Last I checked, CFLAGS ends up getting used for both host utilities
>>>> and at least some of the target/boot code. That might be a bug in the
>>>> build system.
>>>>
>>>>
>>> CFLAGS is used as default for TARGET_CFLAGS. If it happens in another
>>> context it's most likely a bug. Can you provide more details?
>>
>> Sure. If I configure with this script:
>>
>> #!/bin/sh
>> CHOST=x86_64-pc-linux-gnu
>> CBUILD=$CHOST
>> CTARGET=armv7a-hardfloat-linux-gnueabi
>> S="${HOME}"/src/grub
>>
>> # This will cause a build failure if passed to armv7a compiler
>> export CFLAGS="-march=x86-64"
>> export TARGET_CFLAGS="-Os"
>>
>> "${S}"/configure --build="${CBUILD}" --host="${CHOST}" --target="${CTARGET}"
>>
>>
>> I get this build failure:
>>
>> armv7a-hardfloat-linux-gnueabi-gcc -DHAVE_CONFIG_H -I.
>> -I/home/floppym/src/grub/grub-core -I.. -Wall -W
>> -I/home/floppym/src/grub/include -I../include -DGRUB_MACHINE_UBOOT=1
>> -DGRUB_MACHINE=ARM_UBOOT -nostdinc -isystem
>> /usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.8.3/include
>> -DGRUB_FILE=\"lib/disk.c\" -I. -I/home/floppym/src/grub/grub-core -I..
>> -I/home/floppym/src/grub -I/home/floppym/src/grub/include -I../include
>> -I/home/floppym/src/grub/grub-core/lib/libgcrypt-grub/src/ -Os
>> -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment
>> -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero
>> -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k
>> -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain
>> -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses
>> -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch
>> -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function
>> -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable
>> -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g
>> -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations
>> -Wcast-align -Wextra -Wattributes -Wendif-labels -Winit-self
>> -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers
>> -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing
>> -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign
>> -Wmissing-prototypes -Wmissing-declarations -Wformat=2
>> -freg-struct-return -fno-dwarf2-cfi-asm
>> -fno-asynchronous-unwind-tables -mlong-calls -mthumb-interwork -Qn
>> -fno-stack-protector -mno-unaligned-access -Wtrampolines -Werror
>> -ffreestanding -march=x86-64 -MT lib/disk_module-disk.o -MD -MP -MF
>
> This is Automake generated rule for dependency tracking. It adds
> $(CFLAGS) indeed. Not sure how we can work around it.
>
CFLAGS is supposed to be set to TARGET_CFLAGS in grub-core/Makefile. I
don't know why it didn't happen.
> ./Makefile: $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(grub_syslinux2cfg_CPPFLAGS) $(CPPFLAGS) $(grub_syslinux2cfg_CFLAGS) $(CFLAGS) -MT grub-core/kern/emu/grub_syslinux2cfg-hostfs.o -MD -MP -MF grub-core/kern/emu/$(DEPDIR)/grub_syslinux2cfg-hostfs.Tpo -c -o grub-core/kern/emu/grub_syslinux2cfg-hostfs.o `test -f 'grub-core/kern/emu/hostfs.c' || echo '$(srcdir)/'`grub-core/kern/emu/hostfs.c
>
> For now I'm afraid the only workaround is "do not do it" - any stray
> C(PP)FLAGS during make run will confuse it ... :(
>
>> lib/.deps-core/disk_module-disk.Tpo -c -o lib/disk_module-disk.o `test
>> -f 'lib/disk.c' || echo '/home/floppym/src/grub/grub-core/'`lib/disk.c
>> armv7a-hardfloat-linux-gnueabi-gcc: error: unrecognized argument in
>> option ‘-march=x86-64’
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/grub-devel
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: HOST_* flags are not used by gnulib
2014-07-27 18:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2014-07-27 18:48 ` Andrey Borzenkov
2014-07-27 18:55 ` Mike Gilbert
0 siblings, 1 reply; 10+ messages in thread
From: Andrey Borzenkov @ 2014-07-27 18:48 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: phcoder
[-- Attachment #1: Type: text/plain, Size: 5080 bytes --]
В Sun, 27 Jul 2014 20:42:36 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:
> On 27.07.2014 20:39, Andrey Borzenkov wrote:
> > В Sun, 27 Jul 2014 14:24:07 -0400
> > Mike Gilbert <floppym@gentoo.org> пишет:
> >
> >> On Sun, Jul 27, 2014 at 2:10 PM, Vladimir 'phcoder' Serbinenko
> >> <phcoder@gmail.com> wrote:
> >>>
> >>> On 27 Jul 2014 20:07, "Mike Gilbert" <floppym@gentoo.org> wrote:
> >>>>
> >>>> On Wed, Jul 23, 2014 at 3:41 AM, Vladimir 'φ-coder/phcoder' Serbinenko
> >>>> <phcoder@gmail.com> wrote:
> >>>>> On 03.04.2014 20:01, Andrey Borzenkov wrote:
> >>>>>> I noticed that host flags are not propagated to gnulib. This does not
> >>>>>> feel right; in particular I noticed it because attempt to enable
> >>>>>> debugging for host tools (HOST_CFLAGS=-g) did not work for gnulib
> >>>>>> files.
> >>>>>>
> >>>>> It should be just CFLAGS (refer to INSTALL)
> >>>>
> >>>> Last I checked, CFLAGS ends up getting used for both host utilities
> >>>> and at least some of the target/boot code. That might be a bug in the
> >>>> build system.
> >>>>
> >>>>
> >>> CFLAGS is used as default for TARGET_CFLAGS. If it happens in another
> >>> context it's most likely a bug. Can you provide more details?
> >>
> >> Sure. If I configure with this script:
> >>
> >> #!/bin/sh
> >> CHOST=x86_64-pc-linux-gnu
> >> CBUILD=$CHOST
> >> CTARGET=armv7a-hardfloat-linux-gnueabi
> >> S="${HOME}"/src/grub
> >>
> >> # This will cause a build failure if passed to armv7a compiler
> >> export CFLAGS="-march=x86-64"
> >> export TARGET_CFLAGS="-Os"
> >>
> >> "${S}"/configure --build="${CBUILD}" --host="${CHOST}" --target="${CTARGET}"
> >>
> >>
> >> I get this build failure:
> >>
> >> armv7a-hardfloat-linux-gnueabi-gcc -DHAVE_CONFIG_H -I.
> >> -I/home/floppym/src/grub/grub-core -I.. -Wall -W
> >> -I/home/floppym/src/grub/include -I../include -DGRUB_MACHINE_UBOOT=1
> >> -DGRUB_MACHINE=ARM_UBOOT -nostdinc -isystem
> >> /usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.8.3/include
> >> -DGRUB_FILE=\"lib/disk.c\" -I. -I/home/floppym/src/grub/grub-core -I..
> >> -I/home/floppym/src/grub -I/home/floppym/src/grub/include -I../include
> >> -I/home/floppym/src/grub/grub-core/lib/libgcrypt-grub/src/ -Os
> >> -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment
> >> -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero
> >> -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k
> >> -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain
> >> -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses
> >> -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch
> >> -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function
> >> -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable
> >> -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g
> >> -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations
> >> -Wcast-align -Wextra -Wattributes -Wendif-labels -Winit-self
> >> -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers
> >> -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing
> >> -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign
> >> -Wmissing-prototypes -Wmissing-declarations -Wformat=2
> >> -freg-struct-return -fno-dwarf2-cfi-asm
> >> -fno-asynchronous-unwind-tables -mlong-calls -mthumb-interwork -Qn
> >> -fno-stack-protector -mno-unaligned-access -Wtrampolines -Werror
> >> -ffreestanding -march=x86-64 -MT lib/disk_module-disk.o -MD -MP -MF
> >
> > This is Automake generated rule for dependency tracking. It adds
> > $(CFLAGS) indeed. Not sure how we can work around it.
> >
> CFLAGS is supposed to be set to TARGET_CFLAGS in grub-core/Makefile. I
> don't know why it didn't happen.
It sets AM_CFLAGS, not CFLAGS.
AM_CFLAGS = $(TARGET_CFLAGS)
> > ./Makefile: $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(grub_syslinux2cfg_CPPFLAGS) $(CPPFLAGS) $(grub_syslinux2cfg_CFLAGS) $(CFLAGS) -MT grub-core/kern/emu/grub_syslinux2cfg-hostfs.o -MD -MP -MF grub-core/kern/emu/$(DEPDIR)/grub_syslinux2cfg-hostfs.Tpo -c -o grub-core/kern/emu/grub_syslinux2cfg-hostfs.o `test -f 'grub-core/kern/emu/hostfs.c' || echo '$(srcdir)/'`grub-core/kern/emu/hostfs.c
> >
> > For now I'm afraid the only workaround is "do not do it" - any stray
> > C(PP)FLAGS during make run will confuse it ... :(
> >
> >> lib/.deps-core/disk_module-disk.Tpo -c -o lib/disk_module-disk.o `test
> >> -f 'lib/disk.c' || echo '/home/floppym/src/grub/grub-core/'`lib/disk.c
> >> armv7a-hardfloat-linux-gnueabi-gcc: error: unrecognized argument in
> >> option ‘-march=x86-64’
> >>
> >> _______________________________________________
> >> Grub-devel mailing list
> >> Grub-devel@gnu.org
> >> https://lists.gnu.org/mailman/listinfo/grub-devel
> >
> >
> > _______________________________________________
> > Grub-devel mailing list
> > Grub-devel@gnu.org
> > https://lists.gnu.org/mailman/listinfo/grub-devel
> >
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: HOST_* flags are not used by gnulib
2014-07-27 18:48 ` Andrey Borzenkov
@ 2014-07-27 18:55 ` Mike Gilbert
0 siblings, 0 replies; 10+ messages in thread
From: Mike Gilbert @ 2014-07-27 18:55 UTC (permalink / raw)
To: The development of GNU GRUB
On Sun, Jul 27, 2014 at 2:48 PM, Andrey Borzenkov <arvidjaar@gmail.com> wrote:
> В Sun, 27 Jul 2014 20:42:36 +0200
> Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:
>
>> On 27.07.2014 20:39, Andrey Borzenkov wrote:
>> > В Sun, 27 Jul 2014 14:24:07 -0400
>> > Mike Gilbert <floppym@gentoo.org> пишет:
>> >
>> >> On Sun, Jul 27, 2014 at 2:10 PM, Vladimir 'phcoder' Serbinenko
>> >> <phcoder@gmail.com> wrote:
>> >>>
>> >>> On 27 Jul 2014 20:07, "Mike Gilbert" <floppym@gentoo.org> wrote:
>> >>>>
>> >>>> On Wed, Jul 23, 2014 at 3:41 AM, Vladimir 'φ-coder/phcoder' Serbinenko
>> >>>> <phcoder@gmail.com> wrote:
>> >>>>> On 03.04.2014 20:01, Andrey Borzenkov wrote:
>> >>>>>> I noticed that host flags are not propagated to gnulib. This does not
>> >>>>>> feel right; in particular I noticed it because attempt to enable
>> >>>>>> debugging for host tools (HOST_CFLAGS=-g) did not work for gnulib
>> >>>>>> files.
>> >>>>>>
>> >>>>> It should be just CFLAGS (refer to INSTALL)
>> >>>>
>> >>>> Last I checked, CFLAGS ends up getting used for both host utilities
>> >>>> and at least some of the target/boot code. That might be a bug in the
>> >>>> build system.
>> >>>>
>> >>>>
>> >>> CFLAGS is used as default for TARGET_CFLAGS. If it happens in another
>> >>> context it's most likely a bug. Can you provide more details?
>> >>
>> >> Sure. If I configure with this script:
>> >>
>> >> #!/bin/sh
>> >> CHOST=x86_64-pc-linux-gnu
>> >> CBUILD=$CHOST
>> >> CTARGET=armv7a-hardfloat-linux-gnueabi
>> >> S="${HOME}"/src/grub
>> >>
>> >> # This will cause a build failure if passed to armv7a compiler
>> >> export CFLAGS="-march=x86-64"
>> >> export TARGET_CFLAGS="-Os"
>> >>
>> >> "${S}"/configure --build="${CBUILD}" --host="${CHOST}" --target="${CTARGET}"
>> >>
>> >>
>> >> I get this build failure:
>> >>
>> >> armv7a-hardfloat-linux-gnueabi-gcc -DHAVE_CONFIG_H -I.
>> >> -I/home/floppym/src/grub/grub-core -I.. -Wall -W
>> >> -I/home/floppym/src/grub/include -I../include -DGRUB_MACHINE_UBOOT=1
>> >> -DGRUB_MACHINE=ARM_UBOOT -nostdinc -isystem
>> >> /usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.8.3/include
>> >> -DGRUB_FILE=\"lib/disk.c\" -I. -I/home/floppym/src/grub/grub-core -I..
>> >> -I/home/floppym/src/grub -I/home/floppym/src/grub/include -I../include
>> >> -I/home/floppym/src/grub/grub-core/lib/libgcrypt-grub/src/ -Os
>> >> -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment
>> >> -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero
>> >> -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k
>> >> -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain
>> >> -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses
>> >> -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch
>> >> -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function
>> >> -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable
>> >> -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g
>> >> -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations
>> >> -Wcast-align -Wextra -Wattributes -Wendif-labels -Winit-self
>> >> -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers
>> >> -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing
>> >> -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign
>> >> -Wmissing-prototypes -Wmissing-declarations -Wformat=2
>> >> -freg-struct-return -fno-dwarf2-cfi-asm
>> >> -fno-asynchronous-unwind-tables -mlong-calls -mthumb-interwork -Qn
>> >> -fno-stack-protector -mno-unaligned-access -Wtrampolines -Werror
>> >> -ffreestanding -march=x86-64 -MT lib/disk_module-disk.o -MD -MP -MF
>> >
>> > This is Automake generated rule for dependency tracking. It adds
>> > $(CFLAGS) indeed. Not sure how we can work around it.
>> >
>> CFLAGS is supposed to be set to TARGET_CFLAGS in grub-core/Makefile. I
>> don't know why it didn't happen.
>
> It sets AM_CFLAGS, not CFLAGS.
>
> AM_CFLAGS = $(TARGET_CFLAGS)
>
Right. I end up with this in grub-core/Makefile:
CFLAGS = -march=x86-64
...
AM_CFLAGS = $(TARGET_CFLAGS)
...
lib/disk_module-disk.o: lib/disk.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
$(disk_module_CPPFLAGS) $(CPPFLAGS) $(disk_module_CFLAGS) $(CFLAGS)
-MT lib/disk_module-disk.o -MD -MP -MF
lib/$(DEPDIR)/disk_module-disk.Tpo -c -o lib/disk_module-disk.o `test
-f 'lib/disk.c' || echo '$(srcdir)/'`lib/disk.c
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: HOST_* flags are not used by gnulib
2014-07-23 7:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-07-27 18:06 ` Mike Gilbert
@ 2014-07-28 2:52 ` Andrey Borzenkov
1 sibling, 0 replies; 10+ messages in thread
From: Andrey Borzenkov @ 2014-07-28 2:52 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: phcoder
[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]
В Wed, 23 Jul 2014 09:41:38 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:
> On 03.04.2014 20:01, Andrey Borzenkov wrote:
> > I noticed that host flags are not propagated to gnulib. This does not
> > feel right; in particular I noticed it because attempt to enable
> > debugging for host tools (HOST_CFLAGS=-g) did not work for gnulib files.
> >
> It should be just CFLAGS (refer to INSTALL)
The problem is that CFLAGS leak into target. Default compilation
command used by automake is
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
And any initial CFLAGS setting is passed through to all generated
Makefiles.
So instructions in INSTALL are, unfortunately, wrong - CFLAGS cannot be
safely used to initialize host environment.
> > Is it intentional?
> >
> > _______________________________________________
> > Grub-devel mailing list
> > Grub-devel@gnu.org
> > https://lists.gnu.org/mailman/listinfo/grub-devel
> >
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-07-28 2:53 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03 18:01 HOST_* flags are not used by gnulib Andrey Borzenkov
2014-07-23 7:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-07-27 18:06 ` Mike Gilbert
2014-07-27 18:10 ` Vladimir 'phcoder' Serbinenko
2014-07-27 18:24 ` Mike Gilbert
2014-07-27 18:39 ` Andrey Borzenkov
2014-07-27 18:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-07-27 18:48 ` Andrey Borzenkov
2014-07-27 18:55 ` Mike Gilbert
2014-07-28 2:52 ` Andrey Borzenkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).