OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 7:22 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to compile a kernel in C++ using a cross compiler?
PostPosted: Mon May 08, 2017 8:10 pm 
Offline

Joined: Tue Feb 28, 2017 11:44 am
Posts: 7
I recently started porting my kernel project to c++ (from C) and tried to compile it with the same cross compiler I use to compile my C kernel. The problem is that GCC calls Ubuntu's G++ instead of calling the cross-compiler G++. Therefore when the cross compiler linker tries to link the kernel it can't read the object files. How do I fix this?

Thanks in advance


Top
 Profile  
 
 Post subject: Re: How to compile a kernel in C++ using a cross compiler?
PostPosted: Mon May 08, 2017 11:56 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
When you created the cross-compiler did you specify C++ as one of the languages it could compile?


Top
 Profile  
 
 Post subject: Re: How to compile a kernel in C++ using a cross compiler?
PostPosted: Tue May 09, 2017 7:49 am 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
Do you invoke {x86_64,i386}-{elf,youros}-g++ or plain g++? Is i386-elf-g++ in your path?

_________________
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].


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], SemrushBot [Bot] and 48 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group