[Barrelfish-users] Compiling barrelfish without -O2?
Patrik Eklöf
peklof at kth.se
Sat Jun 9 02:51:05 CEST 2012
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?
Regards,
Patrik Eklöf
Student at ICT, Master of Science in Engineering Education, IT Programme, KTH, Kista
________________________________________
From: Simon Peter [speter at inf.ethz.ch]
Sent: Friday, June 08, 2012 11:00
To: Patrik Eklöf
Subject: Re: [Barrelfish-users] Compiling barrelfish without -O2?
Hi Patrick,
I remember we had this same problem once. The compiler thinks it runs
out of registers in the user-space thread switch function.
I believe a newer compiler version might fix this problem. However, I'm
not so certain and I'm also not sure if this is a bug on our side or on
behalf of the compiler.
What you can do as an interim solution is to compile this file with -O2
and the others without -O2. I typically do that by executing this
compile manually with the -O2 flag and then re-executing make, which
will do the rest.
Sorry I can't be of more help here...
Simon
On 06.06.2012 17:32, Patrik Eklöf wrote:
> Hi all,
>
> I've been trying to compile BF with the -O2 flag, in order to disable
> all optimizations to debug BF properly, but it seems that it always
> fails if I do that.
> The error I am getting is:
>
> [localhost debug_build]$ make
> gcc -std=c99 -U__STRICT_ANSI__ -Wstrict-prototypes
> -Wold-style-definition -Wmissing-prototypes -fno-omit-frame-pointer
> -fno-builtin -nostdinc -U__linux__ -Ulinux -Wall -Wshadow
> -Wmissing-declarations -Wmissing-field-initializers -Wredundant-decls
> -Werror -imacros ../source/include/deputy/nodeputy.h -m64 -mno-red-zone
> -fPIE -fno-stack-protector -Wno-unused-but-set-variable
> -Wno-packed-bitfield-compat -DBARRELFISH -DCONFIG_QEMU_NETWORK
> -DCONFIG_LAZY_THC -DCONFIG_NEWLIB -DCONFIG_INTERCONNECT_DRIVER_LMP
> -DCONFIG_INTERCONNECT_DRIVER_UMP -DCONFIG_INTERCONNECT_DRIVER_MULTIHOP
> -DCONFIG_FLOUNDER_BACKEND_LMP -DCONFIG_FLOUNDER_BACKEND_UMP
> -DCONFIG_FLOUNDER_BACKEND_MULTIHOP -gdwarf-2 -I../source/include
> -I../source/include/arch/x86_64
> -I../source/lib/newlib/newlib/libc/include -I../source/include/c
> -I../source/include/target/x86_64 -I../source/include/ipv4
> -I../source/include/posixcompat -I./x86_64/include
> -I./x86_64/include/dev -I../source/lib/barrelfish
> -I./x86_64/lib/barrelfish -I../source/lib/barrelfish/include
> -I../source/lib/barrelfish/include/arch/x86_64 -o
> ./x86_64/lib/barrelfish/_for_lib_barrelfish/arch/x86_64/dispatch.o -c
> ../source/lib/barrelfish/arch/x86_64/dispatch.c
> ../source/lib/barrelfish/arch/x86_64/dispatch.c: In function ‘disp_switch’:
> ../source/lib/barrelfish/arch/x86_64/dispatch.c:168:5: error: can’t find
> a register in class ‘GENERAL_REGS’ while reloading ‘asm’
> ../source/lib/barrelfish/arch/x86_64/dispatch.c:168:5: error: ‘asm’
> operand has impossible constraints
> make: ***
> [x86_64/lib/barrelfish/_for_lib_barrelfish/arch/x86_64/dispatch.o] Error 1
>
> Is there a way to fix that? Note that I'm still using rev 483. I don't
> know if it has been fixed in subsequent commits.
>
> Regards,
> Patrik Eklöf
> Student at ICT, Master of Science in Engineering Education, IT
> Programme, KTH, Kista
>
>
>
> _______________________________________________
> 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