* nostdlib compilation
@ 2013-08-27 21:51 Nulik Nol
2013-08-27 22:15 ` Rich Felker
0 siblings, 1 reply; 2+ messages in thread
From: Nulik Nol @ 2013-08-27 21:51 UTC (permalink / raw)
To: musl
Hi,
I am looking for a way to compile my app without glibc, and according
to some examples it can be done with:
gcc -nostdlib stubstart.S -o myprogram myprogram.c
but in order to use the kernel I also need the system calls.
What are the files I should also include from musl in order to be able
to invoke kernel system calls but without glibc?
Will appreciate very much your help.
Regards
Nulik
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: nostdlib compilation
2013-08-27 21:51 nostdlib compilation Nulik Nol
@ 2013-08-27 22:15 ` Rich Felker
0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2013-08-27 22:15 UTC (permalink / raw)
To: musl
On Tue, Aug 27, 2013 at 04:51:17PM -0500, Nulik Nol wrote:
> Hi,
> I am looking for a way to compile my app without glibc, and according
> to some examples it can be done with:
> gcc -nostdlib stubstart.S -o myprogram myprogram.c
> but in order to use the kernel I also need the system calls.
> What are the files I should also include from musl in order to be able
> to invoke kernel system calls but without glibc?
Most people do this with their own inline asm, but these files should
be sufficient to make syscalls:
src/misc/syscall.c
src/internal/$(ARCH)/syscall.s
I'm not 100% sure they work outside of musl; they might have other
dependencies. Looking at arch/$(ARCH)/syscall_arch.h to see how to
make your own inline-asm syscalls would be a better approach, I think.
Rich
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-27 22:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-27 21:51 nostdlib compilation Nulik Nol
2013-08-27 22:15 ` Rich Felker
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).