[Barrelfish-users] Compiling barrelfish without -O2?
Patrik Eklöf
peklof at kth.se
Tue Jun 12 16:27:15 CEST 2012
I've tried directly modifying the Makefile too, but I just can't seem to shake that undefined reference problem.
I don't understand these Hakefiles. I don't know how to add extra compilation flags.
Is there some information about how these Hakefiles work somewhere? Is there an easy way to modify the Hakefiles to change the compilation flags for the dispatch.c file?
Regards,
Patrik Eklöf
Student at ICT, Master of Science in Engineering Education, IT Programme, KTH, Kista
________________________________________
From: Patrik Eklöf peklof-at-kth.se |barrelfish-essentia| [oyxtmlu0wt at sneakemail.com]
Sent: Monday, June 11, 2012 17:33
To: Patrik Eklöf; Kornilios Kourtis
Cc: barrelfish-users at lists.inf.ethz.ch
Subject: Re: [Barrelfish-users] Compiling barrelfish without -O2?
It seems that system is necessary for compiling BF. I'm afraid of what will happen if I try to disable more and more functionality in order to get it compiling...
gcc -gdwarf-2 ./x86_64/lib/crt0.o ./x86_64/lib/crtbegin.o -fno-builtin -nostdlib -Wl,-z,max-page-size=0x1000 -Wl,--build-id=none -m64 -o ./x86_64/sbin/skb ./x86_64/usr/skb/_for_app_skb/skb_main.o ./x86_64/usr/skb/_for_app_skb/skb_service.o ./x86_64/usr/skb/_for_app_skb/skb_flounder_bindings.o ./x86_64/lib/libeclipse.a ./x86_64/lib/libshm.a ./x86_64/lib/libdummies.a ./x86_64/lib/libicsolver.a ./x86_64/lib/libvfs.a ./x86_64/lib/libnfs.a ./x86_64/lib/libposixcompat.a ./x86_64/lib/liblwip.a ./x86_64/lib/libcontmng.a ./x86_64/lib/libprocon.a ./x86_64/lib/libvfsfd.a ./x86_64/lib/libtimer.a ./x86_64/lib/libhashtable.a ./x86_64/lib/libbarrelfish.a ./x86_64/errors/errno.o ./x86_64/lib/libnewlib.a ./x86_64/lib/crtend.o ./x86_64/lib/libcollections..a
../x86_64/lib/libeclipse.a(bip_io.o): In function `p_rename':
/run/media/mana/bf/Barrelfish/build/../source/usr/skb/eclipse_kernel/src/bip_io.c:1139: undefined reference to `system'
collect2: error: ld returned 1 exit status
make: *** [x86_64/sbin/skb] Error 1
Is there no one who actually compiles BF without the O2 flag?
Regards,
Patrik Eklöf
Student at ICT, Master of Science in Engineering Education, IT Programme, KTH, Kista
________________________________________
From: Kornilios Kourtis [kornilios.kourtis at inf.ethz.ch]
Sent: Monday, June 11, 2012 10:59
To: Patrik Eklöf
Cc: Simon Peter; barrelfish-users at lists.inf.ethz.ch
Subject: Re: [Barrelfish-users] Compiling barrelfish without -O2?
Hi Patrik,
On Sat, Jun 09, 2012 at 12:51:05AM +0000, Patrik Eklöf wrote:
> Well, I tried upgrading to gcc 4.7, but the problem persists.
> I also tried manually compiling the faulting file, and it worked, but I
> ran into another problem:
>
> gcc -gdwarf-2 ./x86_64/lib/crt0.o ./x86_64/lib/crtbegin.o -fno-builtin -nostdlib -Wl,-z,max-page-size=0x1000 -Wl,--build-id=none -m64 -o ./x86_64/sbin/skb ./x86_64/usr/skb/_for_app_skb/skb_main.o ./x86_64/usr/skb/_for_app_skb/skb_service.o ./x86_64/usr/skb/_for_app_skb/skb_flounder_bindings.o ../x86_64/lib/libeclipse.a ./x86_64/lib/libshm.a ./x86_64/lib/libdummies.a ./x86_64/lib/libicsolver.a ./x86_64/lib/libvfs.a ./x86_64/lib/libnfs.a ./x86_64/lib/libposixcompat.a ./x86_64/lib/liblwip.a ./x86_64/lib/libcontmng.a ./x86_64/lib/libprocon.a ./x86_64/lib/libvfsfd.a ./x86_64/lib/libtimer.a ./x86_64/lib/libhashtable.a ./x86_64/lib/libbarrelfish.a ./x86_64/errors/errno..o ./x86_64/lib/libnewlib.a ./x86_64/lib/crtend.o ./x86_64/lib/libcollections.a
> ./x86_64/lib/libnewlib.a(system.o): In function `do_system':
> /run/media/mana/bf/Barrelfish/build/../source/lib/newlib/newlib/libc/stdlib/system.c:134: undefined reference to `_fork_r'
> /run/media/mana/bf/Barrelfish/build/../source/lib/newlib/newlib/libc/stdlib/system.c:143: undefined reference to `_wait_r'
> collect2: error: ld returned 1 exit status
> make: *** [x86_64/sbin/skb] Error 1
>
> Re-compiling this with the -O2 flag does not seem to help.
> Any ideas?
This is a linking problem, the linker can't find the symbols for fork and
wait. I am not sure what exactly happened, but I suspect that the manual
compilation caused this problem somehow.
The clean way would be to use Hakefiles to change the compilation flags
as needed. Since system() won't work for barrelfish (fork() is not
supported), a quick fix for the above problem would be to disable
system() by commenting out "system.c" in
lib/newlib/newlib/libc/stdlib/Hakefile.
cheers,
Kornilios.
--
Kornilios Kourtis
_______________________________________________
Barrelfish-users mailing list
Barrelfish-users at lists.inf.ethz.ch
https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users
More information about the Barrelfish-users
mailing list