OSDev.org

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

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: compiler-rt without red zone
PostPosted: Tue Oct 12, 2021 4:20 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
Hello,
I am working on making my OS support Clang. I see no tutorial on how to build compiler-rt with -mno-red-zone, however.

I tried taking matters into my own hands by looking through compiler-rt's build system to figure out how to do this. I theory, this should be easy (just find a place where x86_64 specific C flags can be put and add -mno-red-zone), but compiler-rt's x86 appears to bundle x86_64 and i386, which probably would mess up the build

Any tips on this?

Thanks,
nexos

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: compiler-rt without red zone
PostPosted: Wed Oct 13, 2021 2:47 am 
Offline
Member
Member

Joined: Mon Jul 05, 2021 6:57 pm
Posts: 118
For cmake projects I typically run "ccmake ." to show available options (press 't' to toggle advanced options).

For compiler-rt it looks like there are "CMAKE_C_FLAGS" and "CMAKE_CXX_FLAGS" which are standard for C/C++ projects. Your build process with cmake is probably something like:

Code:
mkdir build
cd build
cmake .. -DCMAKE_C_FLAGS=-mno-red-zone -DCMAKE_CXX_FLAGS=-mno-red-zone
make


(edit: I haven't actually tried to build).


Top
 Profile  
 
 Post subject: Re: compiler-rt without red zone
PostPosted: Wed Oct 13, 2021 3:01 am 
Offline
Member
Member

Joined: Mon Jul 05, 2021 6:57 pm
Posts: 118
Also, use:

Code:
make VERBOSE=1


... to actually see the compilation commands.


Top
 Profile  
 
 Post subject: Re: compiler-rt without red zone
PostPosted: Wed Oct 13, 2021 2:36 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
Thanks, I didn't think of that!

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: DotBot [Bot], Majestic-12 [Bot] and 67 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