Skip to content

Commit a8b621c

Browse files
authored
修正由于libc中具有crti.S和crtn.S,造成的与x86_64-elf-gcc不兼容的问题 (#144)
1 parent 9358ff0 commit a8b621c

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

user/libs/libc/src/arch/x86_64/Makefile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ ECHO:
77
$(libc_arch_objs): ECHO
88
$(CC) $(CFLAGS) -c $@ -o $@.o
99

10-
all: $(libc_arch_objs) crti.o crtn.o
10+
# 由于目前使用的是raw的gcc,所以不需要crti.o和crtn.o(待更换为x86_64-dragonos-gcc后再改这里)
11+
# all: $(libc_arch_objs) crti.o crtn.o
12+
all: $(libc_arch_objs)
1113
mv crt0.c.o crt0.o
1214

13-
crti.o: crti.S
14-
$(CC) -E crti.S > _crti.s # 预处理
15-
$(AS) $(ASFLAGS) -o crti.o _crti.s
15+
# crti.o: crti.S
16+
# $(CC) -E crti.S > _crti.s # 预处理
17+
# $(AS) $(ASFLAGS) -o crti.o _crti.s
1618

17-
crtn.o: crtn.S
18-
$(CC) -E crtn.S > _crtn.s # 预处理
19-
$(AS) $(ASFLAGS) -o crtn.o _crtn.s
19+
# crtn.o: crtn.S
20+
# $(CC) -E crtn.S > _crtn.s # 预处理
21+
# $(AS) $(ASFLAGS) -o crtn.o _crtn.s
2022

2123
clean:
2224

user/libs/libc/src/arch/x86_64/crt0.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,11 @@ void _start(int argc, char **argv)
1313
_libc_init();
1414
int retval = main(argc, argv);
1515
exit(retval);
16+
}
17+
18+
void _init(){
19+
20+
}
21+
void _fini(){
22+
1623
}

0 commit comments

Comments
 (0)