I am writing a kernel in c++ and I wanted to use libsupc++. After some struggling I managed to get g++ to compile.
I fixed all the missing symbols and compiled but now I am getting a new error
Code: Select all
x86_64-elf-gcc -ffreestanding -nostdlib -z max-page-size=0x1000 -T linker.ld -g -o vmmse obj/gdt.o obj/common/panic.o obj/common/printf.o obj/common/stacktrace.o obj/loader.o obj/drivers/keyboard.o obj/drivers/syscallintr.o obj/drivers/mouse.o obj/kernel.o obj/multiboot2.o obj/gdtr.o obj/loader_feat.o obj/libupcxx.o obj/libc/string.o obj/hw/interruptstubs.o obj/hw/ports.o obj/hw/interrupts.o obj/pmm.o -lgcc -lsupc++
/usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/bin/ld: /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_personality.o): in function `__gxx_personality_v0':
/home/msee/src/build-gcc/x86_64-elf/libstdc++-v3/libsupc++/../../../../gcc-8.2.0/libstdc++-v3/libsupc++/eh_personality.cc:558:(.text.__gxx_personality_v0+0x32d): relocation truncated to fit: R_X86_64_32 against symbol `typeinfo for __cxxabiv1::__forced_unwind' defined in .rodata._ZTIN10__cxxabiv115__forced_unwindE[typeinfo for __cxxabiv1::__forced_unwind] section in /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_exception.o)
/usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/bin/ld: /home/msee/src/build-gcc/x86_64-elf/libstdc++-v3/libsupc++/../../../../gcc-8.2.0/libstdc++-v3/libsupc++/eh_personality.cc:564:(.text.__gxx_personality_v0+0x341): relocation truncated to fit: R_X86_64_32 against symbol `typeinfo for __cxxabiv1::__foreign_exception' defined in .rodata._ZTIN10__cxxabiv119__foreign_exceptionE[typeinfo for __cxxabiv1::__foreign_exception] section in /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_exception.o)
/usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/bin/ld: /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_personality.o): in function `__cxa_call_unexpected':
/home/msee/src/build-gcc/x86_64-elf/libstdc++-v3/libsupc++/../../../../gcc-8.2.0/libstdc++-v3/libsupc++/eh_personality.cc:782:(.text.unlikely.__cxa_call_unexpected+0x45): relocation truncated to fit: R_X86_64_32 against symbol `typeinfo for std::bad_exception' defined in .rodata._ZTISt13bad_exception[typeinfo for std::bad_exception] section in /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_exception.o)
/usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/bin/ld: /home/msee/src/build-gcc/x86_64-elf/libstdc++-v3/libsupc++/../../../../gcc-8.2.0/libstdc++-v3/libsupc++/eh_personality.cc:783:(.text.unlikely.__cxa_call_unexpected+0x89): relocation truncated to fit: R_X86_64_32 against symbol `std::bad_exception::~bad_exception()' defined in .text._ZNSt13bad_exceptionD2Ev section in /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_exception.o)
/usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/bin/ld: /home/msee/src/build-gcc/x86_64-elf/libstdc++-v3/libsupc++/../../../../gcc-8.2.0/libstdc++-v3/libsupc++/eh_personality.cc:783:(.text.unlikely.__cxa_call_unexpected+0x8e): relocation truncated to fit: R_X86_64_32 against symbol `typeinfo for std::bad_exception' defined in .rodata._ZTISt13bad_exception[typeinfo for std::bad_exception] section in /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_exception.o)
/usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/bin/ld: /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_personality.o):(.eh_frame+0x15b): relocation truncated to fit: R_X86_64_32 against symbol `__gxx_personality_v0' defined in .text.__gxx_personality_v0 section in /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_personality.o)
/usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/bin/ld: /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_personality.o):(.eh_frame+0x179): relocation truncated to fit: R_X86_64_32 against `.gcc_except_table.__gxx_personality_v0'
/usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/bin/ld: /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_personality.o):(.eh_frame+0x1cb): relocation truncated to fit: R_X86_64_32 against symbol `__gxx_personality_v0' defined in .text.__gxx_personality_v0 section in /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_personality.o)
/usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/bin/ld: /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_personality.o):(.eh_frame+0x1f9): relocation truncated to fit: R_X86_64_32 against `.gcc_except_table.__gxx_personality_v0'
/usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/bin/ld: /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_personality.o):(.eh_frame+0x211): relocation truncated to fit: R_X86_64_32 against `.gcc_except_table.__cxa_call_unexpected'
/usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/bin/ld: /usr/local/cross/lib/gcc/x86_64-elf/8.2.0/../../../../x86_64-elf/lib/libsupc++.a(eh_personality.o):(.eh_frame+0x23f): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Makefile:33: recipe for target 'vmmse' failed
make: *** [vmmse] Error 1
or did I mess something up in the code
I used newlib to compile if that matters