|
Post by barryk on Jun 7, 2017 2:07:17 GMT 1
Hi guys, I am playing with OpenEmbedded (OE), which is a cross-compiler that build an entire Linux distribution from source packages. I have used it successfully on a x86_64 host, targeting x86_64, i586 and armv7. Have compiled everything, from the kernel up to big apps such as libreoffice.
To build a complete Puppy Linux or Quirky Linux, I have about a dozen packages still to be imported into OE, including bacon and puppy-tools. The latter has some utilities written in bacon.
I have not yet succeeded to compile bacon, but am reporting the first hurdle.
I am doing a build for target x86_64. The configure step went okay, however make failed. The generated Makefile has this:
prefix = /usr exec_prefix = /usr BINDIR = /usr/bin LIBDIR = /usr/lib DATADIR = $(prefix)/share MANDIR = $(DATADIR)/man STRIP = x86_64-oe-linux-strip CC = x86_64-oe-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/mnt/sdb1/oe/oe-quirky/buildPC/tmp-glibc/work/core2-64-oe-linux/bacon/3.5.4-r0/recipe-sysroot RANLIB = x86_64-oe-linux-ranlib INSTALL = /mnt/sdb1/oe/oe-quirky/buildPC/tmp-glibc/hosttools/install -c BSHELL = bash GUI = false
all : bacon bacongui @echo "Run 'make install' to install BaCon on your system."
bacon : $(BSHELL) ./bacon.sh -a -c $(CC) -r $(RANLIB) -d build bacon.bac $(STRIP) build/bacon
bacongui : @if [ $(GUI) = "true" ]; then \ build/bacon -c $(CC) -d build bacongui.bac; \ $(STRIP) build/bacongui; \ else \ echo "Skipping BaConGUI."; \ fi;
The problem is the insertion of $(CC). I put quotes around it, "$(CC)", and it then proceeded.
Then stopped:
Converting 'bacon.bac'... 8369 Converting 'bacon.bac'... done, 8369 lines were processed in 178 seconds. New BaCon archive requested! Creating... WARNING: 'x86_64-oe-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/mnt/sdb1/oe/oe-quirky/buildPC/tmp-glibc/work/core2-64-oe-linux/bacon/3.5.4-r0/recipe-sysroot' not found on this system! Generated source code cannot be compiled.
Anyway, that is a bug isn't it. the lack of quotes around $(CC)? So, thought that I would report that.
Does anyone know if there has ever been an effort to import bacon into openembedded/yocto?
Regards, Barry
|
|
|
Post by barryk on Jun 7, 2017 2:19:47 GMT 1
If anyone wants to recreate my build of Quirky Linux with OE, I have uploaded a tarball: barryk.org/news/?viewDetailed=00546My host system is Quirky Xerus x86_64. The OE/Yocto website have info on other compatible hosts, with details on what packages to install: www.openembedded.org/wiki/Getting_startedOn my desktop PC, i5 CPU, 16GB RAM, magnetic-HDD, it takes about 9.5 hours. And if you fancy playing with compiling bacon in OE, this is my recipe so far: oe-quirky/meta-quirky/recipes-quirky/bacon/bacon_3.5.4.bb: # Recipe created by recipetool # recipetool create -o bacon_3.5.4.bb http://www.basic-converter.org/stable/bacon-3.5.4.tar.gz
LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://doc-pak/copyright;md5=7aa9a8809e4151b9907173f18f2f815e"
SRC_URI = "http://www.basic-converter.org/stable/bacon-${PV}.tar.gz" SRC_URI[md5sum] = "dc2ef768b547fe559c2577ba5bbfa89d" SRC_URI[sha256sum] = "7b1c72fd46daaa43d19e1bfac2f9bcd9decc5b8443d8f5640e903bfc35e122b9"
# NOTE: the following prog dependencies are unknown, ignoring: pdksh bash ksh lksh mksh zsh DEPENDS = "bash gtk+"
# NOTE: if this software is not capable of being built in a separate build directory # from the source, you should replace autotools with autotools-brokensep in the # inherit line # BK 20170607 broken, do-compile needs to run ./bacon.sh in source... inherit autotools-brokensep
do_compile() { oe_runmake }
# Specify any options you want to pass to the configure script using EXTRA_OECONF: EXTRA_OECONF = "--with-bash --enable-gui"
These are commands that can be used for testing: # bitbake -c clean bacon # bitbake -c configure bacon # bitbake -c compile bacon Regards, Barry
|
|
|
Post by barryk on Jun 7, 2017 10:28:33 GMT 1
Now have a working recipe for OE.
meta-quirky/recipes-quirky/bacon/bacon_3.5.4.bb:
# Recipe created by recipetool # recipetool create -o bacon_3.5.4.bb http://www.basic-converter.org/stable/bacon-3.5.4.tar.gz
LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://doc-pak/copyright;md5=7aa9a8809e4151b9907173f18f2f815e"
SRC_URI = "http://www.basic-converter.org/stable/bacon-${PV}.tar.gz" SRC_URI[md5sum] = "dc2ef768b547fe559c2577ba5bbfa89d" SRC_URI[sha256sum] = "7b1c72fd46daaa43d19e1bfac2f9bcd9decc5b8443d8f5640e903bfc35e122b9"
DEPENDS = "bash gtk+"
# NOTE: if this software is not capable of being built in a separate build directory # from the source, you should replace autotools with autotools-brokensep in the # inherit line # BK 20170607 broken, do_compile needs to run ./bacon.sh in source... inherit autotools-brokensep
do_compile() { mkdir -p build # -n convert to C only, -a rebuild libbacon.a, -p preserve temporary files ... #bash bacon.sh -a -d build bacon.bac #...this works for x86_64 target. but for armv7 target may need to do this... bash bacon.sh -n -p -a -d build bacon.bac cd build ${CC} -fPIC -O2 -c bacon.bac.c for aFILE in bacon.binary.c bacon.chop.c bacon.chr.c bacon.cmdline.c bacon.concat.c bacon.count.c bacon.curdir.c bacon.datename.c bacon.dec.c bacon.dirname.c bacon.epoch.c bacon.error.c bacon.exec.c bacon.extract.c bacon.filelen.c bacon.filetime.c bacon.filetype.c bacon.fill.c bacon.flatten.c bacon.getenviron.c bacon.getkey.c bacon.getpeer.c bacon.getxy.c bacon.hex.c bacon.host.c bacon.hostname.c bacon.inbetween.c bacon.insert.c bacon.instr.c bacon.instrrev.c bacon.lcase.c bacon.left.c bacon.load.c bacon.makedir.c bacon.malloc.c bacon.memcheck.c bacon.mid.c bacon.minmax.c bacon.os.c bacon.peek.c bacon.regex.c bacon.remove.c bacon.replace.c bacon.reverse.c bacon.right.c bacon.screen.c bacon.search.c bacon.sort.c bacon.spc.c bacon.str.c bacon.tab.c bacon.tally.c bacon.time.c bacon.timer.c bacon.token.c bacon.ucase.c bacon.version.c bacon.wait.c do ${CC} -fPIC -O2 -c ${aFILE} done ${AR} -r libbacon.a bacon.binary.o bacon.chop.o bacon.chr.o bacon.cmdline.o bacon.concat.o bacon.count.o bacon.curdir.o bacon.datename.o bacon.dec.o bacon.dirname.o bacon.epoch.o bacon.error.o bacon.exec.o bacon.extract.o bacon.filelen.o bacon.filetime.o bacon.filetype.o bacon.fill.o bacon.flatten.o bacon.getenviron.o bacon.getkey.o bacon.getpeer.o bacon.getxy.o bacon.hex.o bacon.host.o bacon.hostname.o bacon.inbetween.o bacon.insert.o bacon.instr.o bacon.instrrev.o bacon.lcase.o bacon.left.o bacon.load.o bacon.makedir.o bacon.malloc.o bacon.memcheck.o bacon.mid.o bacon.minmax.o bacon.os.o bacon.peek.o bacon.regex.o bacon.remove.o bacon.replace.o bacon.reverse.o bacon.right.o bacon.screen.o bacon.search.o bacon.sort.o bacon.spc.o bacon.str.o bacon.tab.o bacon.tally.o bacon.time.o bacon.timer.o bacon.token.o bacon.ucase.o bacon.version.o bacon.wait.o ${CC} -o bacon bacon.bac.o -L. -lbacon -lm cd .. #also compile bacongui, note, only needs gtk libs at runtime... bash bacon.sh -n -p -d build bacongui.bac cd build ${CC} -fPIC -O2 -c bacongui.bac.c ${CC} -o bacongui bacongui.bac.o -lbacon -lm -L. -ldl cd .. }
do_install() { install -d ${D}/usr/bin install -m755 build/bacon ${D}/usr/bin install -m755 bacon.sh ${D}/usr/bin install -d ${D}/usr/lib install -m755 build/libbacon.a ${D}/usr/lib install -d ${D}/usr/share/BaCon install -m644 bacon.bac ${D}/usr/share/BaCon #and for bacongui... install -m755 build/bacongui ${D}/usr/bin install -d ${D}/usr/share/applications install -d ${D}/usr/share/pixmaps install -m644 bacongui.desktop ${D}/usr/share/applications install -m644 icons/BaCon24.png ${D}/usr/share/pixmaps/BaCon.png }
# Specify any options you want to pass to the configure script using EXTRA_OECONF: EXTRA_OECONF = "--with-bash --enable-gui" # ...do_configure() will run, but we aren't using Makefile.
However, have only tested for target x86_64, host x86_64, so don't know for certain that a cross-compile will work.
Regards, Barry
|
|
|
Post by Pjot on Jun 7, 2017 17:43:50 GMT 1
Thanks barry for sorting this out!
Regarding your remark:
It seems to be caused by the absence of the CFLAGS variable, which should contain the parameters to the C compiler. I will add this to the configure script so it can be exported in the compile environment.
Best regards Peter
|
|
|
Post by barryk on Jun 8, 2017 11:38:29 GMT 1
Ha ha, this is no longer a bug report, perhaps should be moved to a different section of the forum?
I have fully imported bacon and my utilities into OE. OE will create binary .tar.xz packages, 'bacon', 'bacon-hug', 'bacon-hug-imports' and 'pup-tools', that can be used in a build of Puppy or Quirky.
Firstly, 'bacon', this is the recipe bacon_3.5.4.bb:
# Recipe created by recipetool # recipetool create -o bacon_3.5.4.bb http://www.basic-converter.org/stable/bacon-3.5.4.tar.gz
LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://doc-pak/copyright;md5=7aa9a8809e4151b9907173f18f2f815e"
SRC_URI = "http://www.basic-converter.org/stable/bacon-${PV}.tar.gz" SRC_URI[md5sum] = "dc2ef768b547fe559c2577ba5bbfa89d" SRC_URI[sha256sum] = "7b1c72fd46daaa43d19e1bfac2f9bcd9decc5b8443d8f5640e903bfc35e122b9"
DEPENDS = "bash gtk+"
# NOTE: if this software is not capable of being built in a separate build directory # from the source, you should replace autotools with autotools-brokensep in the # inherit line # BK 20170607 broken, do-compile needs to run ./bacon.sh in source... inherit autotools-brokensep
do_compile() { mkdir -p build # -n convert to C only, -a rebuild libbacon.a, -p preserve temporary files, # -y automatically delete temporary files ... #bash bacon.sh -y -a -d build bacon.bac #...this works for x86_64 target. but for armv7 target may need to do this... bash bacon.sh -y -n -p -a -d build bacon.bac cd build ${CC} -fPIC -O2 -c bacon.bac.c for aFILE in bacon.binary.c bacon.chop.c bacon.chr.c bacon.cmdline.c bacon.concat.c bacon.count.c bacon.curdir.c bacon.datename.c bacon.dec.c bacon.dirname.c bacon.epoch.c bacon.error.c bacon.exec.c bacon.extract.c bacon.filelen.c bacon.filetime.c bacon.filetype.c bacon.fill.c bacon.flatten.c bacon.getenviron.c bacon.getkey.c bacon.getpeer.c bacon.getxy.c bacon.hex.c bacon.host.c bacon.hostname.c bacon.inbetween.c bacon.insert.c bacon.instr.c bacon.instrrev.c bacon.lcase.c bacon.left.c bacon.load.c bacon.makedir.c bacon.malloc.c bacon.memcheck.c bacon.mid.c bacon.minmax.c bacon.os.c bacon.peek.c bacon.regex.c bacon.remove.c bacon.replace.c bacon.reverse.c bacon.right.c bacon.screen.c bacon.search.c bacon.sort.c bacon.spc.c bacon.str.c bacon.tab.c bacon.tally.c bacon.time.c bacon.timer.c bacon.token.c bacon.ucase.c bacon.version.c bacon.wait.c do ${CC} -fPIC -O2 -c ${aFILE} done ${AR} -r libbacon.a bacon.binary.o bacon.chop.o bacon.chr.o bacon.cmdline.o bacon.concat.o bacon.count.o bacon.curdir.o bacon.datename.o bacon.dec.o bacon.dirname.o bacon.epoch.o bacon.error.o bacon.exec.o bacon.extract.o bacon.filelen.o bacon.filetime.o bacon.filetype.o bacon.fill.o bacon.flatten.o bacon.getenviron.o bacon.getkey.o bacon.getpeer.o bacon.getxy.o bacon.hex.o bacon.host.o bacon.hostname.o bacon.inbetween.o bacon.insert.o bacon.instr.o bacon.instrrev.o bacon.lcase.o bacon.left.o bacon.load.o bacon.makedir.o bacon.malloc.o bacon.memcheck.o bacon.mid.o bacon.minmax.o bacon.os.o bacon.peek.o bacon.regex.o bacon.remove.o bacon.replace.o bacon.reverse.o bacon.right.o bacon.screen.o bacon.search.o bacon.sort.o bacon.spc.o bacon.str.o bacon.tab.o bacon.tally.o bacon.time.o bacon.timer.o bacon.token.o bacon.ucase.o bacon.version.o bacon.wait.o ${CC} -o bacon bacon.bac.o -L. -lbacon -lm cd .. #also compile bacongui, note, only needs gtk libs at runtime... bash bacon.sh -y -n -p -d build bacongui.bac cd build ${CC} -fPIC -O2 -c bacongui.bac.c ${CC} -o bacongui bacongui.bac.o -lbacon -lm -L. -ldl cd .. }
do_install() { install -d ${D}/usr/bin install -m755 build/bacon ${D}/usr/bin install -m755 bacon.sh ${D}/usr/bin install -d ${D}/usr/lib install -m755 build/libbacon.a ${D}/usr/lib install -d ${D}/usr/share/BaCon install -m644 bacon.bac ${D}/usr/share/BaCon #and for bacongui... install -m755 build/bacongui ${D}/usr/bin install -d ${D}/usr/share/applications install -d ${D}/usr/share/pixmaps install -m644 bacongui.desktop ${D}/usr/share/applications install -m644 icons/BaCon24.png ${D}/usr/share/pixmaps/BaCon.png #see note below... install -m755 bacon.sh ${TMPDIR} }
# usr/share/BaCon is installed but not packaged. this fixes... # note, $datadir defined in meta/conf/bitbake.conf, but can use actual path... FILES_${PN} += "/usr/share/BaCon"
# Specify any options you want to pass to the configure script using EXTRA_OECONF: EXTRA_OECONF = "--with-bash --enable-gui" # ...do_configure() will run, but we aren't using Makefile.
# do_install installs ok, but do not get the usr/bin files in sysroot-destdir, # to be available for execution by pup-tools when it wants to compile bscon src. # ref: https://stackoverflow.com/questions/35354802/how-to-create-do-populate-sysroot-append-task-in-yocto sysroot_stage_all_append () { sysroot_stage_dir ${D}/usr/bin ${SYSROOT_DESTDIR}/usr/bin } # ...installs tmp-glibc/work/*/bacon/3.5.4-r0/sysroot-destdir/usr/bin/bacon.sh, # which should now be visible to pup-tools do_compile, but do not know how to specify # its path. so, using $TMPDIR which is global, see above.
OpenEmbedded (and Yocto) is very unusual. Unlike other cross-compiler build systems, such as T2 and Buildroot, OE does not install each package into one big rootfs as they are compiled. It builds each package in isolation, and creates a mini-rootfs just for each package, with copied files and symlinks. The downside to this is that the normal auto-discovery that the 'configure' script does, doesn't work. You have to know in advance what the hard-dependencies and conditional-dependencies are, and specify them in the recipe.
I think that sometime ago, OE did work in the traditional way, one big rootfs. But, they decided to implement this isolated rootfs for each package. I suppose that they must have considered this move very carefully, but it does seem to have complicated things.
Another downside of this isolation is that a build consumes vast amount of drive space. In my case, about 150GB.
Anyway, about the above recipe. OE creates a mini-rootfs for each package. For 'pup-tools', I specified 'bacon' as a dependency, but it could not find 'bacon.sh', though it is in the installed 'bacon' package. So I had to look into how this mini-rootfs is created. It does make /usr/lib/libbacon.a available to the pup-tools build, but not anything in /usr/bin. You can see in the recipe, I tried the 'sysroot_stage_dir' function, but that didn't work.
So, I ended up with a hack, installing 'bacon.sh' to ${TMPDIR}, which is gloabally visible. Oh well, at least bacon.sh can now be executed in other recipes.
|
|
|
Post by barryk on Jun 8, 2017 11:46:23 GMT 1
I created another recipe 'bacon-hug_0.104.bb':
# Recipe created by recipetool # recipetool create -o bacon-hug_0.104.bb http://www.basic-converter.org/hug.bac
DEPENDS = "bash bacon gtk+"
LICENSE = "GPLv2" LIC_FILES_CHKSUM = ""
SRC_URI = "http://www.basic-converter.org/hug.bac" #SRC_URI[md5sum] = "8a1855b62c16656afba054a8f2dab8da" #SRC_URI[sha256sum] = "889544b8c9cbd1d83abf487f49a7c916c5a99333ab61db302f62b1ac6ae32349" SRC_URI[md5sum] = "" SRC_URI[sha256sum] = "" # this will prevent lack of checksum from throwing an error... BB_STRICT_CHECKSUM = "0"
# hug.bac is not a tarball, so set S (path to source) where hug.bac is located... S = "${WORKDIR}" # also, do my own unpack... do_unpack () { cp -f ${DL_DIR}/hug.bac ${S}/ }
do_configure () { true }
do_compile () { mkdir -p temp1 # -n convert to C only, -a rebuild libbacon.a, -p preserve temporary files, # -y automatically delete temporary files, -x extract gettext strings... ${TMPDIR}/bacon.sh -y -n -p -d temp1 hug.bac cd temp1 ${CC} -fPIC -c hug.bac.c ${CC} -o hug.so hug.bac.o -lbacon -lm -shared -rdynamic -ldl cd .. }
do_install () { install -d ${D}/usr/lib install -m755 temp1/hug.so ${D}/usr/lib }
Notice the "${TMPDIR}/bacon.sh", refer previous post.
|
|
|
Post by barryk on Jun 8, 2017 11:51:00 GMT 1
One more thing about the previous post. I set the checksums to empty, as 'hug.bac' is going to change. When someone runs this recipe in the future, I don't want it to bomb at this point.
A couple of the utilities in 'pup-tools' require 'hug_imports.bac', so I created a recipe 'bacon-hug-imports_0.104.bb':
# Recipe created by recipetool # recipetool create -o bacon-hug-imports_0.104.bb http://www.basic-converter.org/hug_imports.bac
LICENSE = "MIT" LIC_FILES_CHKSUM = ""
SRC_URI = "http://www.basic-converter.org/hug_imports.bac" #SRC_URI[md5sum] = "2c7c9fef5163af45463307d6f7c30b97" #SRC_URI[sha256sum] = "36a4c183671821c987e46ddcbdfd70e30396431759b1fe6cd91e192a596d70ea" SRC_URI[md5sum] = "" SRC_URI[sha256sum] = "" # this will prevent lack of checksum from throwing an error... BB_STRICT_CHECKSUM = "0"
# BK note, see recipe pup-tools*.bb
S = "${WORKDIR}" do_unpack() { cp -f ${DL_DIR}/hug_imports.bac ${S}/ }
do_configure() { true }
do_compile() { true }
do_install () { install -d ${D}/usr/share/BaCon install -m755 hug_imports.bac ${D}/usr/share/BaCon }
FILES_${PN} = "/usr/share/BaCon"
|
|
|
Post by barryk on Jun 8, 2017 11:55:42 GMT 1
Finally, 'pup-tools' are building-block utilities in Puppy and Quirky, some written in bacon. Here is the recipe for OE, 'pup-tools_20170607.bb':
# Recipe created by recipetool # recipetool create -o pup-tools_20170607.bb http://distro.ibiblio.org/quirky/quirky6/sources/alphabetical/p/pup-tools-20170607.tar.gz
DEPENDS = "bacon bacon-hug bacon-hug-imports gtk+"
LICENSE = "GPLv2" LIC_FILES_CHKSUM = ""
SRC_URI = "http://distro.ibiblio.org/quirky/quirky6/sources/alphabetical/p/pup-tools-${PV}.tar.gz" SRC_URI[md5sum] = "08310e9ecf73f9132cd986fd41220ee9" SRC_URI[sha256sum] = "dcf10d407efb412f3bc2d98381a17fc0258dba7777d50f52be885b1faef3b038"
do_configure() { cp -f ${DL_DIR}/hug_imports.bac ${S}/bacon/ cp -f ${DL_DIR}/hug.bac ${S}/bacon/ }
do_compile () { # note, 'pwd' reported: # /mnt/sdb1/oe/oe-quirky/buildPC/tmp-glibc/work/core2-64-oe-linux/pup-tools/20170607-r0/pup-tools-20170607 cd bacon #[ -d temp1 ] && rm -rf temp1 mkdir -p temp1 sed -i -e 's%/usr/share/BaCon%.%' welcome1stboot.bac #hug_imports.bac is local. # -n convert to C only, -a rebuild libbacon.a, -p preserve temporary files, # -y automatically delete temporary files, -x extract gettext strings... ${TMPDIR}/bacon.sh -y -x -n -p -d temp1 welcome1stboot.bac cd temp1 ${CC} -fPIC -c welcome1stboot.bac.c ${CC} -o welcome1stboot welcome1stboot.bac.o -L. -lbacon -lm -ldl cd .. ${TMPDIR}/bacon.sh -y -n -p -d temp1 debdb2pupdb.bac cd temp1 ${CC} -fPIC -c debdb2pupdb.bac.c ${CC} -o debdb2pupdb debdb2pupdb.bac.o -L. -lbacon -lm -ldl cd .. ${TMPDIR}/bacon.sh -y -n -p -d temp1 find_cat.bac cd temp1 ${CC} -fPIC -c find_cat.bac.c ${CC} -o find_cat find_cat.bac.o -L. -lbacon -lm -ldl cd .. ${TMPDIR}/bacon.sh -y -n -p -d temp1 pngoverlay.bac cd temp1 ${CC} -fPIC -c pngoverlay.bac.c ${CC} -o pngoverlay pngoverlay.bac.o -L. -lbacon -lm -ldl cd .. sed -i -e 's%/usr/share/BaCon%.%' popup.bac #hug_imports.bac is local. ${TMPDIR}/bacon.sh -y -n -p -d temp1 popup.bac cd temp1 ${CC} -fPIC -c popup.bac.c ${CC} -o popup popup.bac.o -L. -lbacon -lm -ldl cd .. sed -i -e 's%/usr/share/BaCon%.%' proxy-setup.bac #hug_imports.bac is local. ${TMPDIR}/bacon.sh -x -y -n -p -d temp1 proxy-setup.bac cd temp1 ${CC} -fPIC -c proxy-setup.bac.c ${CC} -o proxy-setup proxy-setup.bac.o -L. -lbacon -lm -ldl cd .. ${TMPDIR}/bacon.sh -y -n -p -d temp1 pup_event_frontend_d.bac cd temp1 ${CC} -fPIC -c pup_event_frontend_d.bac.c ${CC} -o pup_event_frontend_d pup_event_frontend_d.bac.o -L. -lbacon -lm -ldl cd .. sed -i -e "s%'CONST IN_MODIFY=2%CONST IN_MODIFY=2%" pup_event_ipc.bac #170608 ${TMPDIR}/bacon.sh -y -n -p -d temp1 pup_event_ipc.bac cd temp1 ${CC} -fPIC -c pup_event_ipc.bac.c ${CC} -o pup_event_ipc pup_event_ipc.bac.o -L. -lbacon -lm -ldl cd .. cd .. cd gcc for aFILE in printcols truncate vercmp do ${CC} -o ${aFILE} ${aFILE}.c done ${CC} -lX11 getcurpos.c -o getcurpos cd .. }
do_install () { install -d ${D}/bin install -m755 gcc/vercmp ${D}/bin install -d ${D}/usr/bin install -m755 gcc/truncate ${D}/usr/bin install -d ${D}/usr/sbin install -m755 gcc/getcurpos ${D}/usr/sbin install -m755 gcc/printcols ${D}/usr/sbin install -m755 bacon/temp1/pngoverlay ${D}/usr/sbin install -m755 bacon/temp1/popup ${D}/usr/sbin install -m755 bacon/temp1/welcome1stboot ${D}/usr/sbin install -d ${D}/usr/local/petget install -m755 bacon/temp1/debdb2pupdb ${D}/usr/local/petget install -m755 bacon/temp1/find_cat ${D}/usr/local/petget install -d ${D}/usr/local/pup_event install -m755 bacon/temp1/pup_event_frontend_d ${D}/usr/local/pup_event install -m755 bacon/temp1/pup_event_ipc ${D}/usr/local/pup_event install -d ${D}/usr/local/simple_network_setup install -m755 bacon/temp1/proxy-setup ${D}/usr/local/simple_network_setup }
FILES_${PN} += "/usr/local/petget /usr/local/pup_event /usr/local/simple_network_setup"
Note that I will be creating a new tarball of OE with my custom layer, which will have all of the above in it. I will announce it when it is uploaded.
|
|
|
Post by barryk on Jun 25, 2017 9:39:48 GMT 1
To "complete" this thread, my new layer for OpenEmbedded is now on github. It has the recipe for bacon, in fact three recipes, 'bacon', 'bacon-hug' and 'bacon-hug-imports'. Then there is a recipe for 'pup-tools' which are core utilities used in Puppy and derivatives, some of the utilities are written in bacon. Note, BaCon makes it easy in a cross-compile environment, as the bacon.sh can be used to generate C, then the cross-compiler gcc used. Though, in theory, OE can handle running the 'bacon' binary on the host architecture, I just haven't figured out yet how to do that -- as have only been using OE about two months and still quite low on the learning curve. Anyway, here is my blog announcement: barryk.org/news/?viewDetailed=00576And github: github.com/bkauler/oe-qky-src
|
|
|
Post by barryk on Aug 12, 2022 14:49:50 GMT 1
Hi guys! Ha ha, I was thinking of moving over to Nim, instead of coding in BaCon. The fundamental reason, is that some apps cross-compiled in OE work, some segfault. Vovchik's picscale 0.1c is an example of the latter. I never figured out why, so wondered if should move to Nim.
However, it has turned out that cross-compiling Nim in OE is a nightmare. They have a "home grown" build system. There is one guy who created a build recipe for Nim, but after working on it until 5am, realised that there was a reason he never continued with it after the first commit to github -- it doesn't work. I persisted, completely rewrote the build recipe. Hit compile errors that I see lots of other people reporting when they cross-compile.
Have given up. I'm really not satisfied that I never solved why apps such as picscale segfault. So, decided to have another look at it.
I'm compiling BaCon 4.5 in OE, firstly the 'bacon-native_4.5.bb' recipe, which should build the 'bacon' executable to run on the host system. Thus it is not a cross-compile. There will be another recipe 'bacon_4.5.bb' and other recipes, such as for picscale, that will use this native 'bacon'.
I'm compiling this native bacon like this:
mkdir -p build # -n convert to C only, -a rebuild libbacon.a, -p preserve temporary files, # -y automatically delete temporary files ... bash bacon.sh -n -p -a -d build bacon.bac cd build ${CC} -fPIC -O2 ${CFLAGS} -fno-var-tracking-assignments -c bacon.bac.c ${CC} -o bacon bacon.bac.o -L. -lm ${LDFLAGS} cd ..
However, it fails:
| bacon.bac:9951:67: note: in expansion of macro ‘REPLACE__b2c__string_var’ | In file included from bacon.bac.h:2, | from bacon.bac.c:2: | bacon.bac.generic.h:440:7: note: expected ‘char *’ but argument is of type ‘int’ | 440 | char* __b2c_Copy_String(char*,char*); | | ^~~~~~~~~~~~~~~~~
Could you advise me how to fix this?
|
|
|
Post by barryk on Aug 12, 2022 16:26:02 GMT 1
Here is something else very interesting. In OE, running the bacon-native recipe, bacon.sh aborted, claiming that 'pwd' doesn't exist. I hacked the script to keep it going.
Running in my host system:
# bash bacon.sh -n -p -a -d build bacon.bac System error: 'cat', 'rm', 'tr', 'touch', 'uname', 'head' or 'pwd' not found on this system! # type -p pwd # # pwd /mnt/sda1/downloads/downloads2/input614/0-bacon/bacon-4.5 # # which pwd #
Neither "type -p pwd" nor "which pwd" return anything, yet it does exist and it works. It is /bin/pwd and is a symlink to busybox.
Mysterious?
/usr/bin/which is a shell script that calls "type -p $@" So it is that type -p that doesn't like pwd.
tr is also a symlink to busybox, and that works:
# which tr /usr/bin/tr
|
|
|
Post by Pjot on Aug 12, 2022 18:31:26 GMT 1
H Barry, Welcome back to this forum!! Regarding your questions: - in order to reproduce your error, can you provide a little bit more information about your environment? For example (a) your Linux distro, (b) BASH version, (c) GCC version? Note that you also can try to convert with ZSH version 4.x or KSH build 2012 (or later) instead. - regarding the 'which' issue, that's weird. If 'which' does not return the path to a binary, and yet, it *is* available in user accessible directories, then this seems to be a configuration problem in your environment. Please make sure your PATH environment variable does contain the "/bin" directory (see the man page for 'which'). It seems your PATH does contain "/usr/bin"? Thanks, Peter
|
|
|
Post by barryk on Aug 13, 2022 3:55:40 GMT 1
Peter, Thanks for the reply. The problem is not 'which', it is "type -p pwd" that is broken. 'which' itself works. I have /usr/bin/which script that actually runs "type -p $@". The reason for doing this, instead of running the real 'which', is because Debian developers have declared that 'which' is deprecated. The PATH is ok. The problem is just some problem with 'type' -- 'type' is not an executable, it is a builtin to bash and also in busybox ash. My gcc is 9.3.0, glibc is 2.33, running EasyOS 4.3, bash is 5.0 (with some patches). There is no problem compiling BaCon 4.5 in a running EasyOS, the problem is in the cross-compile environment of OpenEmbedded. Though, in this case I am compiling on a x8_64 host OS, for target x86_64 nocona CPU. So host and target CPU are the same, which is usually fine for compiling most apps. Trouble for some apps shows up when have a different target, such as i686 or aarch64. Anyway, as mentioned in previous post, I am attempting to build the "bacon-native" recipe, which has target CPU same as host. Here is the failure report again: | bacon.bac:9951:67: note: in expansion of macro ‘REPLACE__b2c__string_var’ | In file included from bacon.bac.h:2, | from bacon.bac.c:2: | bacon.bac.generic.h:440:7: note: expected ‘char *’ but argument is of type ‘int’ | 440 | char* __b2c_Copy_String(char*,char*); | | ^~~~~~~~~~~~~~~~~ Yes, build/bacon.bac.generic.h has this line: char* __b2c_Copy_String(char*,char*); I have attached the complete do_compile log, gzipped log.do_compile.11360.gz (97.13 KB):
|
|
|
Post by barryk on Aug 13, 2022 4:06:21 GMT 1
Lots of interesting errors reported in that do-compile log!
Looking at the first one, bacon.sh line 9130, seems has assigned variable g_CCNAME=cc, however, in the cross-compile environment it should be g_CCNAME=${CC} In other words, the script should see that $CC is set and use that.
Though, as you can see a few posts back, I got around that problem by converting to C only, then compiling with $CC, $CFLAGS and $LDFLAGS. These are all set appropriately in OE.
And just to confirm, no problem compiling on the host system:
# bash bacon.sh -n -p -a -d build bacon.bac # cd build # cc -fPIC -O2 -fno-var-tracking-assignments -c bacon.bac.c # cc -o bacon bacon.bac.o -L. -lm
|
|
|
Post by barryk on Aug 13, 2022 4:36:52 GMT 1
Attached is the do_configure log, which has something strange in it. gtk+ and gtk+3 are not dependencies, and the way OE works, the build environment for each package is setup with only the core apps and the declared dependencies available. I also explicitly disabled: --disable-gui-gtk --disable-gui-fltk ...though that isn't required, as they are not there anyway. However, the configure log shows: Congratulations, all requirements are met!
- Makefile created. - Using 'bash' to compile BaCon. - Creating BaConGUI for GTK. log.do_configure.9250.gz (2.49 KB)
|
|