- 论坛徽章:
- 0
|
gcc 4.3编译不过 太新了? 和76楼一样
本帖最后由 bxfqing 于 2010-04-15 17:11 编辑
我修改了GCC的编译选项 文件 makefile.os
编译通过了,不知道取消了栈保护会有什么后果
- CCFLG = -O2 -c -nostdinc -fno-stack-protector -fno-builtin -I$(INCLUDE) -I.
复制代码
最新的源代码:- Linking...
- ======================================LIBS======================================
- ./obj/main.o ./lib/kernel.a ./lib/char.a ./lib/block.a ./lib/mm.a ./lib/fs.a ./lib/kernellib.a ./lib/test.a
- ================================================================================
- ./lib/kernel.a(vsprintf.o): In function `number':
- vsprintf.c:(.text+0x221): undefined reference to `__stack_chk_fail'
- ./lib/mm.a(memory.o): In function `free_page':
- memory.c:(.text+0x72e): undefined reference to `__stack_chk_fail'
- make: *** [kernel.bin] Error 1
复制代码- servo@servo-laptop:/opt/fairysky0.01$ gcc -v
- Using built-in specs.
- Target: i486-linux-gnu
- Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
- Thread model: posix
- gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)
复制代码
查看mm.a文件,的确有未声明的函数
- servo@servo-laptop:/opt/fairysky0.01$ nm -a ./lib/mm.a
- memory.o:
- 00000000 b .bss
- 00000000 n .comment
- 00000000 d .data
- 00000000 n .note.GNU-stack
- 00000000 r .rodata.str1.1
- 00000000 r .rodata.str1.4
- 00000000 t .text
- U __stack_chk_fail
- 00000390 T copy_page_table
- U current
- 00000060 T do_no_page
- 000004d0 T do_wp_page
- 00000670 T free_page
- 00000000 T get_free_page
- 00000070 T init_mem
- 00000008 b max_mem
- 00000000 D mem_map
- 0000000c b mem_map_size
- 00000000 b mem_start_index
- U memcpy
- 00000000 a memory.c
- U memset
- 00000004 b page_num
- U panic
- 00000004 C pparams
- U printk
- 00000740 T put_page
- U sprintf
复制代码 |
|