* [Buildroot] [Bug 4327] New: I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work
@ 2011-10-19 5:14 bugzilla at busybox.net
2011-10-31 13:47 ` [Buildroot] [Bug 4327] " bugzilla at busybox.net
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: bugzilla at busybox.net @ 2011-10-19 5:14 UTC (permalink / raw)
To: buildroot
https://bugs.busybox.net/show_bug.cgi?id=4327
Summary: I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does
not work
Product: buildroot
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: minor
Priority: P5
Component: Other
AssignedTo: unassigned at buildroot.uclibc.org
ReportedBy: xiaxiaojin at safefw.com
CC: buildroot at uclibc.org
Estimated Hours: 0.0
grub-0.97 did not play any patch.
gcc ?? 4.6.1 (Buildroot 2011.11-git)
root [ grub-0.97 ]# ./configure --host=i686 CC=i686-linux-gcc --disable-ffs
--prefix=/usr
make
make check
make install
GNU GRUB version 0.97 (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub> root (hd1,0)
Filesystem type is reiserfs, partition type 0x83
grub> setup (hd1)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/reiserfs_stage1_5" exists... yes
Running "embed /grub/reiserfs_stage1_5 (hd1)"... 23 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd1) (hd1)1+23 p (hd1,0)/grub/stage2
/grub/menu.lst"... failed
Error 6: Mismatched or corrupt version of stage1/stage2
grub>
root [ grub-0.94 ]# i686-linux-gcc -v
???? specs?
COLLECT_GCC=i686-linux-gcc
COLLECT_LTO_WRAPPER=/mnt/lfs/toolchain/i-uClibc-0.9.32-x86/usr/libexec/gcc/i686-unknown-linux-uclibc/4.6.1/lto-wrapper
???i686-unknown-linux-uclibc
????/mnt/lfs/buildroot-2011.11-git/output/toolchain/gcc-4.6.1/configure
--prefix=/mnt/lfs/toolchain/i-uClibc-0.9.32-x86/usr --build=i686-pc-linux-gnu
--host=i686-pc-linux-gnu --target=i686-unknown-linux-uclibc
--enable-languages=c,c++
--with-sysroot=/mnt/lfs/toolchain/i-uClibc-0.9.32-x86/usr/i686-unknown-linux-uclibc/sysroot
--with-build-time-tools=/mnt/lfs/toolchain/i-uClibc-0.9.32-x86/usr/i686-unknown-linux-uclibc/bin
--disable-__cxa_atexit --enable-target-optspace --enable-libgomp --with-gnu-ld
--disable-libssp --disable-multilib --enable-tls --enable-shared
--with-gmp=/mnt/lfs/toolchain/i-uClibc-0.9.32-x86/usr
--with-mpfr=/mnt/lfs/toolchain/i-uClibc-0.9.32-x86/usr
--with-mpc=/mnt/lfs/toolchain/i-uClibc-0.9.32-x86/usr --enable-threads
--disable-decimal-float --with-arch=i686 --with-tune=i686
--with-pkgversion='Buildroot 2011.11-git'
--with-bugurl=http://bugs.buildroot.net/
?????posix
gcc ?? 4.6.1 (Buildroot 2011.11-git)
flooder62 [ /mnt ]# fdisk -l
Disk /dev/hda: 125 MB, 125829120 bytes
255 heads, 63 sectors/track, 15 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 15 120456 83 Linux
Disk /dev/sda: 8011 MB, 8011120640 bytes
247 heads, 62 sectors/track, 1021 cylinders
Units = cylinders of 15314 * 512 = 7840768 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 1021 7817766 83 Linux
flooder62 [ /mnt ]# dmesg|grep -i sda
sd 2:0:0:0: [sda] 15646720 512-byte logical blocks: (8.01 GB/7.46 GiB)
sd 2:0:0:0: [sda] Write Protect is off
sd 2:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 2:0:0:0: [sda] Assuming drive cache: write through
sd 2:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
sd 2:0:0:0: [sda] Assuming drive cache: write through
sd 2:0:0:0: [sda] Attached SCSI removable disk
REISERFS (device sda1): found reiserfs format "3.6" with standard journal
REISERFS (device sda1): using ordered data mode
REISERFS (device sda1): journal params: device sda1, size 8192, journal first
block 18, max trans len 1024, max batch 900, max commit age 30, max trans age
30
REISERFS (device sda1): checking transaction log (sda1)
REISERFS (device sda1): Using r5 hash to sort names
REISERFS (device sda1): Created .reiserfs_priv - reserved for xattr storage.
flooder62 [ /mnt ]# uname -sa
Linux flooder62 2.6.32-flz62 #45 SMP Tue Jul 12 09:40:59 GMT 2011 i686
GNU/Linux
flooder62 [ /mnt ]# ls /lib/lib*
/lib/libc.so /lib/libgcc_s.so /lib/libpthread.so
/lib/libuClibc-0.9.32.so
/lib/libc.so.0 /lib/libgcc_s.so.1 /lib/libpthread.so.0
/lib/libutil-0.9.32.so
/lib/libc.so.6 /lib/libm-0.9.32.so /lib/libresolv-0.9.32.so
/lib/libutil.so.0
/lib/libcrypt-0.9.32.so /lib/libm.so /lib/libresolv.so
/lib/libz.so
/lib/libcrypt.so /lib/libm.so.0 /lib/libresolv.so.0
/lib/libz.so.1
/lib/libcrypt.so.0 /lib/libnsl-0.9.32.so /lib/librt-0.9.32.so
/lib/libz.so.1.2.5
/lib/libdl-0.9.32.so /lib/libnsl.so /lib/librt.so
/lib/libdl.so /lib/libnsl.so.0 /lib/librt.so.0
/lib/libdl.so.0 /lib/libpthread-0.9.32.so /lib/librt.so.1
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [Bug 4327] I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work
2011-10-19 5:14 [Buildroot] [Bug 4327] New: I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work bugzilla at busybox.net
@ 2011-10-31 13:47 ` bugzilla at busybox.net
2011-12-06 20:18 ` bugzilla at busybox.net
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bugzilla at busybox.net @ 2011-10-31 13:47 UTC (permalink / raw)
To: buildroot
https://bugs.busybox.net/show_bug.cgi?id=4327
--- Comment #1 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 2011-10-31 13:47:34 UTC ---
We have a grub package in Buildroot. Please use it to build grub.
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [Bug 4327] I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work
2011-10-19 5:14 [Buildroot] [Bug 4327] New: I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work bugzilla at busybox.net
2011-10-31 13:47 ` [Buildroot] [Bug 4327] " bugzilla at busybox.net
@ 2011-12-06 20:18 ` bugzilla at busybox.net
2011-12-06 20:54 ` bugzilla at busybox.net
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bugzilla at busybox.net @ 2011-12-06 20:18 UTC (permalink / raw)
To: buildroot
https://bugs.busybox.net/show_bug.cgi?id=4327
--- Comment #2 from Jaap Crezee <jaap@jcz.nl> 2011-12-06 20:18:36 UTC ---
Same problem over here when using buildroot-2011.11, selecting gcc-4.6.x and
'using' buildroot compiled grub.
The generated file stage2 seems corrupt (it is not recognized as being a grub
component by 'file' which works fine on other systems with grub 0.97)...
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [Bug 4327] I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work
2011-10-19 5:14 [Buildroot] [Bug 4327] New: I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work bugzilla at busybox.net
2011-10-31 13:47 ` [Buildroot] [Bug 4327] " bugzilla at busybox.net
2011-12-06 20:18 ` bugzilla at busybox.net
@ 2011-12-06 20:54 ` bugzilla at busybox.net
2012-01-31 22:10 ` bugzilla at busybox.net
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bugzilla at busybox.net @ 2011-12-06 20:54 UTC (permalink / raw)
To: buildroot
https://bugs.busybox.net/show_bug.cgi?id=4327
--- Comment #3 from Jaap Crezee <jaap@jcz.nl> 2011-12-06 20:54:52 UTC ---
No problem with grub when using gcc 4.5.x (file stage2 recognises grub
component...).
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [Bug 4327] I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work
2011-10-19 5:14 [Buildroot] [Bug 4327] New: I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work bugzilla at busybox.net
` (2 preceding siblings ...)
2011-12-06 20:54 ` bugzilla at busybox.net
@ 2012-01-31 22:10 ` bugzilla at busybox.net
2012-07-25 13:40 ` bugzilla at busybox.net
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bugzilla at busybox.net @ 2012-01-31 22:10 UTC (permalink / raw)
To: buildroot
https://bugs.busybox.net/show_bug.cgi?id=4327
--- Comment #4 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 2012-01-31 22:10:22 UTC ---
Could you test the patch applied on the Ubuntu package, as discussed at
https://bugs.launchpad.net/ubuntu/+source/grub/+bug/837815 ?
Something like:
--- grub-0.97.orig/debian/patches/no-reorder-functions.diff
+++ grub-0.97/debian/patches/no-reorder-functions.diff
@@ -0,0 +1,27 @@
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -113,6 +113,22 @@
+ if test "x$no_stack_protector_flag" = xyes; then
+ STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector"
+ fi
++ # GCC >= 3.3 supports -fno-reorder-functions; this defends us against
++ # unlikely-to-be-executed functions being linked before _start with GCC
++ # >= 4.6.
++ AC_CACHE_CHECK([whether gcc has -fno-reorder-functions],
++ no_reorder_functions_flag, [
++ saved_CFLAGS=$CFLAGS
++ CFLAGS="-fno-reorder-functions"
++ AC_TRY_COMPILE(,
++ ,
++ no_reorder_functions_flag=yes,
++ no_reorder_functions_flag=no)
++ CFLAGS=$saved_CFLAGS
++ ])
++ if test "x$no_reorder_functions_flag" = xyes; then
++ STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-reorder-functions"
++ fi
+ fi
+ fi
+
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [Bug 4327] I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work
2011-10-19 5:14 [Buildroot] [Bug 4327] New: I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work bugzilla at busybox.net
` (3 preceding siblings ...)
2012-01-31 22:10 ` bugzilla at busybox.net
@ 2012-07-25 13:40 ` bugzilla at busybox.net
2013-04-05 22:34 ` bugzilla at busybox.net
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bugzilla at busybox.net @ 2012-07-25 13:40 UTC (permalink / raw)
To: buildroot
https://bugs.busybox.net/show_bug.cgi?id=4327
--- Comment #5 from Jonathan Liu <net147@gmail.com> 2012-07-25 13:40:41 UTC ---
(In reply to comment #4)
> Could you test the patch applied on the Ubuntu package, as discussed at
> https://bugs.launchpad.net/ubuntu/+source/grub/+bug/837815 ?
>
> Something like:
>
> --- grub-0.97.orig/debian/patches/no-reorder-functions.diff
> +++ grub-0.97/debian/patches/no-reorder-functions.diff
> @@ -0,0 +1,27 @@
> +Index: b/configure.ac
> +===================================================================
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -113,6 +113,22 @@
> + if test "x$no_stack_protector_flag" = xyes; then
> + STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector"
> + fi
> ++ # GCC >= 3.3 supports -fno-reorder-functions; this defends us against
> ++ # unlikely-to-be-executed functions being linked before _start with GCC
> ++ # >= 4.6.
> ++ AC_CACHE_CHECK([whether gcc has -fno-reorder-functions],
> ++ no_reorder_functions_flag, [
> ++ saved_CFLAGS=$CFLAGS
> ++ CFLAGS="-fno-reorder-functions"
> ++ AC_TRY_COMPILE(,
> ++ ,
> ++ no_reorder_functions_flag=yes,
> ++ no_reorder_functions_flag=no)
> ++ CFLAGS=$saved_CFLAGS
> ++ ])
> ++ if test "x$no_reorder_functions_flag" = xyes; then
> ++ STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-reorder-functions"
> ++ fi
> + fi
> + fi
> +
The patch does not work for me. Even after configure is regenerated,
STAGE2_CFLAGS is empty. However, the patch from
https://dev.openwrt.org/browser/trunk/package/grub/patches/030-add-stage2-ldscripts.patch
works for me.
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [Bug 4327] I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work
2011-10-19 5:14 [Buildroot] [Bug 4327] New: I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work bugzilla at busybox.net
` (4 preceding siblings ...)
2012-07-25 13:40 ` bugzilla at busybox.net
@ 2013-04-05 22:34 ` bugzilla at busybox.net
2013-11-14 0:20 ` bugzilla at busybox.net
2013-11-14 5:59 ` bugzilla at busybox.net
7 siblings, 0 replies; 9+ messages in thread
From: bugzilla at busybox.net @ 2013-04-05 22:34 UTC (permalink / raw)
To: buildroot
https://bugs.busybox.net/show_bug.cgi?id=4327
--- Comment #6 from Aleksandar <aleksandar.zivkovic@gmail.com> 2013-04-05 22:35:31 UTC ---
(In reply to comment #4)
> Could you test the patch applied on the Ubuntu package, as discussed at
> https://bugs.launchpad.net/ubuntu/+source/grub/+bug/837815 ?
Ubuntu package approach works at my side but not in the way given in Comment 4.
Seems that configuration logic doesn't work or it is overriden with debian
patch. Now, I'm aware that my way is hardcoding and not final solution to
problem but at least it can be used until more systematic solution is added.
Patch given here is executed after debian patch is applied. Logic to determine
gcc version is missing in my approach. Also patch after debian patch is not in
Buildroot spirit.
1) patch file: boot/grub/grub.500-gcc4_6_3.patch.after_debian_patch
diff -Naur a/configure b/configure
--- a/configure 2013-04-06 00:10:40.998698398 +0200
+++ b/configure 2013-04-06 00:26:40.610662350 +0200
@@ -3532,7 +3532,7 @@
fi
fi
fi
-
+STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-reorder-functions"
2) update of boot/grub/grub.mk
@@ -46,6 +46,7 @@
(cd $(@D) ; for f in `cat debian/patches/00list | grep -v ^#` ; do \
cat debian/patches/$$f | patch -g0 -p1 ; \
done)
+ patch -d $(@D) -p1 <
boot/grub/grub.500-gcc4_6_3.patch.after_debian_patch
endef
GRUB_POST_PATCH_HOOKS += GRUB_DEBIAN_PATCHES
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [Bug 4327] I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work
2011-10-19 5:14 [Buildroot] [Bug 4327] New: I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work bugzilla at busybox.net
` (5 preceding siblings ...)
2013-04-05 22:34 ` bugzilla at busybox.net
@ 2013-11-14 0:20 ` bugzilla at busybox.net
2013-11-14 5:59 ` bugzilla at busybox.net
7 siblings, 0 replies; 9+ messages in thread
From: bugzilla at busybox.net @ 2013-11-14 0:20 UTC (permalink / raw)
To: buildroot
https://bugs.busybox.net/show_bug.cgi?id=4327
--- Comment #7 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 2013-11-14 00:20:15 UTC ---
I've recently posted a set of patches against grub, and it was working for me
on x86. Can you test the patches at
http://lists.busybox.net/pipermail/buildroot/2013-November/082351.html and
report if they fix the problem for you?
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [Bug 4327] I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work
2011-10-19 5:14 [Buildroot] [Bug 4327] New: I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work bugzilla at busybox.net
` (6 preceding siblings ...)
2013-11-14 0:20 ` bugzilla at busybox.net
@ 2013-11-14 5:59 ` bugzilla at busybox.net
7 siblings, 0 replies; 9+ messages in thread
From: bugzilla at busybox.net @ 2013-11-14 5:59 UTC (permalink / raw)
To: buildroot
https://bugs.busybox.net/show_bug.cgi?id=4327
??? <xiaxiaojin@safefw.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
--- Comment #8 from ??? <xiaxiaojin@safefw.com> 2013-11-14 05:59:28 UTC ---
Sorry, my toolchain is gone. So close this bug.
Thank you very much.
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-11-14 5:59 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-19 5:14 [Buildroot] [Bug 4327] New: I use the i686-linux-gcc-4.6.1 compiled grub-0.97 does not work bugzilla at busybox.net
2011-10-31 13:47 ` [Buildroot] [Bug 4327] " bugzilla at busybox.net
2011-12-06 20:18 ` bugzilla at busybox.net
2011-12-06 20:54 ` bugzilla at busybox.net
2012-01-31 22:10 ` bugzilla at busybox.net
2012-07-25 13:40 ` bugzilla at busybox.net
2013-04-05 22:34 ` bugzilla at busybox.net
2013-11-14 0:20 ` bugzilla at busybox.net
2013-11-14 5:59 ` bugzilla at busybox.net
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox