Page 1 of 1

Compiling dr'ex

Posted: Wed Nov 05, 2008 4:50 am
by louvros10
Hi everyone!
I 'm sure that there are a lot of people that can help me compile the dr'ex source code.
My problem is that when I type make on the containing folder of drex-murgiahack-0.0.6, I get the following:

Code: Select all

make -C mm ../mm.o
make[1]: Entering directory `/home/andreas/drex--murgiahack/mm'
ld -r mm.o getfreepage.o ppage.o metaslab.o slabcache.o   -o ../mm.o
make[1]: Leaving directory `/home/andreas/drex--murgiahack/mm'
make -C timing ../timing.o
make[1]: Entering directory `/home/andreas/drex--murgiahack/timing'
ld -r events.o timer.o timing.o   -o ../timing.o
make[1]: Leaving directory `/home/andreas/drex--murgiahack/timing'
make -C elf ../elf.o
make[1]: Entering directory `/home/andreas/drex--murgiahack/elf'
ld -r elf.o   -o ../elf.o
make[1]: Leaving directory `/home/andreas/drex--murgiahack/elf'
make -C api ../api.o
make[1]: Entering directory `/home/andreas/drex--murgiahack/api'
ld -r api.o syscall.o sys_aspace.o sys_uthread.o temp.o   -o ../api.o
make[1]: Leaving directory `/home/andreas/drex--murgiahack/api'
make -C capsys ../capsys.o
make[1]: Entering directory `/home/andreas/drex--murgiahack/capsys'
ld -r cap.o capsys.o capset.o   -o ../capsys.o
make[1]: Leaving directory `/home/andreas/drex--murgiahack/capsys'
ld -T =utils/ldscript boot.o kern.o cons.o mm.o timing.o elf.o api.o capsys.o -o drex 
boot.o: In function `printf':
(.text+0x5d6): undefined reference to `__stack_chk_fail'
boot.o: In function `ce_3':
(.text+0x1798): undefined reference to `__stack_chk_fail'
boot.o: In function `ce_11':
(.text+0x187e): undefined reference to `__stack_chk_fail'
boot.o: In function `ce_10':
(.text+0x1960): undefined reference to `__stack_chk_fail'
boot.o: In function `ce_17':
(.text+0x1a54): undefined reference to `__stack_chk_fail'
boot.o:(.text+0x1b33): more undefined references to `__stack_chk_fail' follow
make: *** [drex] Error 1
I hope that someone can help me...
Thanks in advance!!!

Re: Compiling dr'ex

Posted: Wed Nov 05, 2008 5:06 am
by JamesM
-fno-stack-protector.

In other news - what on earth is dr'ex?

Re: Compiling dr'ex

Posted: Wed Nov 05, 2008 5:12 am
by louvros10
-fno-stack-protector??? I 'm a beginner...what is this???
Dr'ex is an exokernel listed in the project section of OSDev.org
https://sourceforge.net/projects/drex/

Re: Compiling dr'ex

Posted: Wed Nov 05, 2008 5:18 am
by louvros10
Hm...buffer overflow protection...
So what to do to overcome this???

Re: Compiling dr'ex

Posted: Wed Nov 05, 2008 6:24 am
by DeletedAccount
Are you using djgpp or mingw or cygwin or linux ? give the version which you are using

Re: Compiling dr'ex

Posted: Wed Nov 05, 2008 6:32 am
by louvros10
I'm on Ubuntu 8.10.

Re: Compiling dr'ex

Posted: Wed Nov 05, 2008 10:03 am
by DeletedAccount
Add the above option to the CFLAGS or something like that in the make file

Re: Compiling dr'ex

Posted: Fri Nov 07, 2008 11:34 am
by louvros10
Well...this is the makefile of dr'ex murgiahack-0.0.6:

Code: Select all

# Configurable Section

BASH= bash

# Makefile Start

SUBDIRS= boot kern cons mm timing elf api capsys
SUBDOBJ= $(addsuffix .o, $(basename $(SUBDIRS)))


.PHONY : config subdirs clean $(SUBDIRS)

drex: subdirs
	ld -T =utils/ldscript $(SUBDOBJ) -o drex 
	nm drex | sort > drex.symbols
	strip drex

subdirs: $(SUBDIRS)

$(SUBDIRS):
	$(MAKE) -C $@ ../[email protected]


clean: 
	for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean; done
	-rm drex drex.symbols
Where and what should I add ...???

Re: Compiling dr'ex

Posted: Fri Nov 07, 2008 9:58 pm
by thepowersgang
In the sub-directories of the dr'ex source tree there will be more Makefiles, you want to alter the 'CFLAGS' value in these files.

Re: Compiling dr'ex

Posted: Sat Nov 08, 2008 8:11 am
by Combuster
Which smells like bad design :(

Re: Compiling dr'ex

Posted: Sat Nov 08, 2008 10:11 am
by 01000101
__stack_chk_fail errors are also due to arrays being within functions and not declared static, you could always change those, but beyond that, I believe JamesM supplied the gcc argument you need to remove the error message.