WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED] subject editted....can script use different toolchain please?  (Read 2788 times)

aus9

  • Guest
hi

Due to my poor compile skills on TC....I built grub2 on a debian system following the wiki here
http://wiki.tinycorelinux.com/Creating+Extensions

The trouble is....I can't see any mention of CXXFLAGS even though I set it before running the configure file.

I know its a long bow for someone to trouble shoot....but as I lack the skills maybe someone can spot where I went wrong?

If interested here are the 2 files that might be of interest?

http://stashbox.org/922963/g2-config.txt

and the Makefile missing flags

http://stashbox.org/931638/Makefile

Questions if I may?

1) do I need cxxflags set for the devs to accept a package build on a non-TC distro?

2) Do some distros not use CXXFLAGS?

3) or is there some other reason why I can't spot this flag?

thanks for reading

PS.....my tcz installs just fine.....I am just trying to get it ready for submission status

Bits taken from both files look reasonable to me....but I don't count heh heh

Code: [Select]

 $ ./configure --prefix=/usr/local


Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.4-2' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
 --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id
 --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4
--program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all
--with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix


CC = gcc
CFLAGS = -march=i486 -mtune=i686 -Os -pipe -DGRUB_MACHINE_PCBIOS=1
ASFLAGS =
LDFLAGS = -Wl,-O1 $(LIBS)
« Last Edit: June 27, 2010, 02:33:43 AM by aus9 »

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: [SOLVED] grub2: makefile is missing CXXFLAGS
« Reply #1 on: June 20, 2010, 12:45:14 AM »
why don't you build it in TC ? there is everything you need to build anything

for your main question does grub2 even have a c++ code ? if so there is no need to CXXFLAGS
« Last Edit: June 20, 2010, 12:48:03 AM by Arslan S. »

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: [SOLVED] grub2: makefile is missing CXXFLAGS
« Reply #2 on: June 20, 2010, 04:15:06 AM »
I'm also surprised why one would bother with "foreign" compilation. Apart from the question whether an extension created that way is acceptable for the wider public I imagine all sorts of headaches with library version etc.

As I have done for some private tests my own build of GRUB2 I'm attaching the build script I've used for that purpose. Since I did not quite get around to make use of it until now I have to state that the result has only received some fairly light testing. Nevertheless it might be useful for what you are trying to do.

aus9

  • Guest
Re: [SOLVED] grub2: makefile is missing CXXFLAGS
« Reply #3 on: June 20, 2010, 05:12:45 AM »
Arsian

Because I lacked the skills.

Yes I agree there would be reservations about accepting a tcz based on a different distro.....thats why I posted.

It does not explain why I could not compile when maro can and did.

who cares now?
------------------------------------------------------------------------------
maro

Thankyou very much for your script.

Forgive any rudeness....not intended....but I have just run scipt and it creates 2 tcz files...grub2 and the locale.....the doc will be ignored as the wiki will suffice.

I will honour your intentions and keep them separate.
I also will add in my grub.cfg

and still stubbornly persist with a grub2 font file....but that was built on TC.

To anyone interested.

I have designed grub2 to use an absolute config file just like grub-legacy.

Smarter people like maro can probably tell my I am doing it all wrong......grins sheepishly.

but hey....I look like an idiot because I have drunk too much aussie beer.
Steinlager is also quaffable but I digress.

Until that brilliant script came along.....I was almost at testing my build instructions. Now I can slink away and start afresh

Thankyou all

unpublished wiki is here...
http://wiki.tinycorelinux.com/gfx


feel free to tell me more harsh truths....grins again

regards

gordy


aus9

  • Guest
Re: subject editted....can script use different toolchain please?
« Reply #4 on: June 21, 2010, 05:24:51 AM »
oops I spoke too soon.

ok here was my "defining" test.....in VirtualBox......IMHO

1) boot live cd...mount partition and wipe contents of boot/grub which was setup with grub-legacy hard drive persistence is sda1

install with my debian tcz version of grub2.tcz....and use a really basic grub.cfg using vi

menuentry {
linux /boot/bzImage tce=sda1
initrd /boot/tinycore.gz
}

Before reboot....check contents of boot/grub looks good

it boots

2) while still in booted hard drive mode....wipe boot/grub contents

install "build" grub2.tcz and use same grub.cfg  above

Before reboot....check contents of boot/grub looks good.......it looks exactly the same....although I did not count each file at this stage.

it fails to boot....dropping me into grub rescue ....error disk not found
(not the normal.mod but the disk or drive)

3) Re-looking at INSTALL file at source for grub2 it states

"* GCC 4.1.3 or later
* GNU Make
* GNU Bison 2.3 or later
* GNU gettext 0.17 or later
* GNU binutils 2.9.1.0.23 or later
* Other standard GNU/Unix tools"

I am wondering if the error lies with not using gcc 4.4.0  or with binutils 2.19.1?

any feedback would be greatly appreciated.

PS I get no errors on using the same command for MBR install which was
grub-install --no-floppy --root-directory=/mnt/sda1 /dev/sda

4) If any kind soul has the time to suggest how to modify the build script ....if that is all it takes....please help
« Last Edit: June 21, 2010, 05:37:46 AM by aus9 »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14535
Re: subject editted....can script use different toolchain please?
« Reply #5 on: June 21, 2010, 05:41:54 AM »
3) Re-looking at INSTALL file at source for grub2 it states

"* GCC 4.1.3 or later
* GNU Make
* GNU Bison 2.3 or later
* GNU gettext 0.17 or later
* GNU binutils 2.9.1.0.23 or later
* Other standard GNU/Unix tools"

I am wondering if the error lies with not using gcc 4.4.0  or with binutils 2.19.1?

It's not certain, but if this was the issue, I would have thought you'd get an error at compile time.

aus9

  • Guest
HI

I have decided to build the lot using dpkg-deb as I kinda know what I am doing where as I have no idea how to check build scripts.

It also means that I can maintain my own package which is morally acceptable ....heh heh instead of relying on others.

Of course the devs can still refuse my packages as its a free world.