-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new package: smallerc #22569
base: master
Are you sure you want to change the base?
new package: smallerc #22569
Conversation
By the way, can the building recipe |
It can. |
In that case I simply don't specify |
You can check these examples. |
Thanks! |
804ee6a
to
56748c7
Compare
Strange that it builds for me w/o |
From what I understand it is a compiler for DOS, Linux (...), but only for x86 architecture. Will it work on ARM architecture? The question is also whether it is needed, because DosBox and DosEmu2 are x86 emulators, so they can use SmallerC for x86 |
Yes - as a cross-compiler.
Yes, they can use SmallerC for x86, |
All our packages are built on a x86_64, Ubuntu 24.04 docker host container as a matter of fact. |
From the above gcc spec it doesn't clang - yes, but not for other OSes. |
After lots of experimenting on my What does this mean? What should |
If you use Cross-compilation is fairly complicated, especially for compilers. You need to cross-compile smallerc for the android arches (termux's build script mostly handles this mostly automatically) AND configure smallerc to tell it which arch(es) it should compile for. In gcc-land one talks about the build platform, the host platform and the target platform (see for example https://stackoverflow.com/questions/5139403/whats-the-difference-of-configure-option-build-host-and-target). In this case build platform is x86_64 (ubuntu docker image), host is termux arch, i.e. one of [arm, aarch64, i686, x86_64], and target is "dosbox" or "dosemu2" (or whatever those targets should be called) |
Probably this is the culprit, but what
So I really don't understand what's
Does this all mean that android |
Android uses a different linker and libc than Ubuntu/"standard" linux, you cannot run a termux x86_64 binary in x86_64 "standard" linux and vice versa, see https://wiki.termux.com/wiki/Differences_from_Linux |
Ahha, so does this mean the github So... what would be a solution? |
We mainly use NDK clang running on Ubuntu x86_64 to cross compile for Android. I see that smallerc makefile do compile to smlrcc and then run that smlrcc to compile libs. This will not work and need to be patched or workaround. |
Yep, that's what I've finally realized. :)
So the question for now is: can I use |
To test this is fine (or even better, try in docker image locally). If it works then smallerc should be added to the list in setup-ubuntu.sh |
Probably adding it to |
Are you thinking from docker-image-size perspective, or smallerc-host-version-vs-version-we-build compatibility perspective? |
Done and seems to work. |
I have a few packages that depend |
And what's worse, for the dependent
Which works but looks more than |
You can: Download a readily available built smallerc (if the author release the binary) and use it that way Add the smallerc to Add the host build steps to each build.sh that needs it. I don't advise: Putting the same host build path in different build.sh as it may not work. Generally files in host build directory are discarded and not cached. So the next time you try to build, the path may not exist. You can cache them to |
It appears to exist only since Oracular (24.10),
Will try.
|
I ended up doing it this way.
Am I supposed to access the sources |
Does termux support "host packages"?
Is there something like this, or maybe |
We pretty much do it every time for Qt6 packages
Another example: libwayland-scanner
|
You seem to mean you do
in other packages. So should I instead use the /opt way? |
Ok, re-done the /opt way. |
7068def
to
aa026fb
Compare
I upstreamed the small makefile patch |
This adds SmallerC C compiler. It is cross-platform, and under Termux can be used to compile for dosbox.
There is now an interesting small |
There's no need to explicitly declare relationship like that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
If there's no further comments I'd like to get this merged tomorrow so it doesn't just sit here.
This adds SmallerC C compiler.
It is cross-platform, and under Termux can be used to compile for dosbox. It is also used with dosemu2, which I am also planning to submit.