I created my cross-complier but I want to add some headers.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Darkpony
Posts: 7
Joined: Sun Sep 24, 2017 8:21 am
Freenode IRC: Darkpony

I created my cross-complier but I want to add some headers.

Post by Darkpony »

I originally created a cross compiler for a free standing kernel. I made it using the cross compiler guide for barebones all went well. Can I add more libraries without making a new cross compiler.
Korona
Member
Member
Posts: 999
Joined: Thu May 17, 2007 1:27 pm
Contact:

Re: I created my cross-complier but I want to add some heade

Post by Korona »

Libraries and header files are placed into /usr/lib and /usr/include. If you're using a cross compiler, those paths are not resolved relative to the filesystem root but to the directory that was specified by --with-sysroot. So specify --with-sysroot and then put your headers into <sysroot>/usr/include.

EDIT: IIRC, --with-sysroot is incompatible with --without-headers. To still build the freestanding --with-sysroot environment correctly, build GCC via

Code: Select all

make all-gcc inhibit_libc=true


If you want to build an entire userspace, you might want into the OS-specific toolchain page in the wiki.
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
Post Reply