Open KireinaHoro opened 7 years ago
Probably because of the configure
script behaving oddly on this platform. When I was bootstrapping bash-4.1
, configure
created odd Makefile
s, feeding an option -3s
to gcc in LOCAL_CFLAGS
(which none of the gcc
s I have access to recognizes) and trying to link something like libunix
by -lunix
(in LOCAL_LIBS
).
I don't know why, though, as I got around these by simply removing them :/
Things that looks like to be relevant:
This is about cross-compiling, though.
Using the SDK to build on PC will also make strange things. (like bash-4.1
produces the following:)
gcc -3s -g -DCROSS_COMPILING -o mkbuiltins mkbuiltins.o -lsocket
gcc: error: unrecognized command line option ‘-3s’; did you mean ‘-Os’?
Makefile:201: recipe for target 'mkbuiltins' failed
make[1]: *** [mkbuiltins] Error 1
make[1]: Leaving directory '/home/jsteward/projects/blackberry/playbook-dev-tools/work/bash-4.1/builtins'
Makefile:679: recipe for target 'builtins/builtext.h' failed
make: *** [builtins/builtext.h] Error 1
You can test it here.
Bad news:
We no longer ship a self-hosted version of QNX SDP (that is, you can no longer use the QNX Neutrino RTOS itself to develop programs).
Source: http://www.qnx.com/developers/articles/rel_5849_7.html#Deprecated
Welcome to porting and cross compiling. :-)
qcc is indeed the QNX CC, but if you run it with the -v flag from the SDK it emits some stuff about looking for gcc, so it seems like gcc might do most of the work? In any event, python is probably looking for it because python has been ported to QNX, so the build system is expecting qcc to be installed as the system compiler.
You can often get hints about how to configure / patch something so it will compile natively from the QNX pkgsrc repo:
http://community.qnx.com/sf/projects/pkgsrc/
Browse under the 'Source Code' tab and navigate to the most recent branch to see the ports tree.
Often you can use the same configuration params or pull patches from here to make the same package compile on BB10, but not always (sometimes BB10 is missing libs or something that are part of the usual QNX install).
Cross compiling sometimes works, and sometimes not. I recall trying to get bash to cross compile some time ago and ended up giving up in favour of mksh. It might compile on the device, but I haven't tried.
In any event, keep at it! Most things will work with a little tweaking. I find the biggest obstacles are missing syslog.h, and anything that uses SA_RESTART with sigaction, but you can usually work around these.
The above link won't open (The page isn’t redirecting properly
)
BTW, how do you generate patches for a file? (for example bootstrap/tmux/client.c.patch
) I'm trying to make some changes but the build system won't accept my patch ..
Sorry for the broken link - I updated the comment to point to the root of the QNX pkgsrc project.
I usually generate patches with diff -u <original> <modified> > patchfile.diff
. Put the patchfile in the patches
directory (eg bootstrap/tmux/patches/client.c.diff
) and it should be automatically applied. If you need to pass a custom -p
patch level you can do that, but the default is -p0
. You can see the package_patch()
routine in lib.sh.
Fine, thanks.
well, i found something interesting:
Oh that is interesting!
I'm trying to cross-compile bash and failed (after hacking on configure{,.in}
for -3s
and -lunix
) because of SA_RESTART
.
Strangely enough, I've succeeded in bootstrapping bash
natively on Q10, when I hadn't ran into issues of SA_RESTART
.
Wondering what made the difference..
Cool! Cross compiling is always a bit tricky, so who knows why it compiles natively and not cross. In any event, I am glad you got it working!
@KireinaHoro wondering if you had any further progress with Gentoo prefix? (Yeah I know the thread is 1.5 years old :wink:)
@vaskas I remember that I tried to bootstrap Gentoo Prefix on that Q10, but gave up later on. I recall that I gave up as Gentoo Prefix's bootstrap script didn't recognize QNX's CHOST, and refused to do things further.
I'm not using a BB10 system anymore, but if you're interested, go on! I think that some obstacles will come for porting Gentoo Prefix onto QNX, but things wouldn't be too hard probably.
Happy hacking!
I'm trying to bootstrap
Gentoo Prefix
after having gotten the toolchain onto my Q10 (and bootstrappingbash
andcurl
). Things likem4
andwget
went smoothly, but when I was buildingpython-2.7.3
I encountered problems.make
complains about not being able to findqcc
:while
qcc
is listed asLINKCC=qcc
in/accounts/1000/documents/gentoo/tmp/var/tmp/python-2.7.3/Python-2.7.3/Makefile
(and perhaps in the subdirectories' Makefiles as well).After some digging around, I found that
qcc
is short for QNX CC and exists in the SDK. I have no idea how python's configure knows about this and how to get it to the device (we certainly don't have QNX CC's source code!)