|
Lines 447-475
Link Here
|
| 447 |
$(common-objpfx)libc% $(+postinit),$^) \ |
447 |
$(common-objpfx)libc% $(+postinit),$^) \ |
| 448 |
$(link-extra-libs) $(link-libc) $(+postctorS) $(+postinit) |
448 |
$(link-extra-libs) $(link-libc) $(+postctorS) $(+postinit) |
| 449 |
endif |
449 |
endif |
|
|
450 |
+link = $(+link-pie) |
| 450 |
# Command for statically linking programs with the C library. |
451 |
# Command for statically linking programs with the C library. |
| 451 |
ifndef +link-static |
452 |
ifndef +link-static |
| 452 |
+link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \ |
453 |
+link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \ |
| 453 |
$(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \ |
454 |
$(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \ |
| 454 |
$(addprefix $(csu-objpfx),$(static-start-installed-name)) \ |
455 |
$(addprefix $(csu-objpfx),S$(static-start-installed-name)) \ |
| 455 |
$(+preinit) $(+prector) \ |
456 |
$(+preinit) $(+prectorS) \ |
| 456 |
$(filter-out $(addprefix $(csu-objpfx),start.o \ |
457 |
$(filter-out $(addprefix $(csu-objpfx),start.o \ |
| 457 |
$(start-installed-name))\ |
458 |
$(start-installed-name))\ |
| 458 |
$(+preinit) $(link-extra-libs-static) \ |
459 |
$(+preinit) $(link-extra-libs-static) \ |
| 459 |
$(common-objpfx)libc% $(+postinit),$^) \ |
460 |
$(common-objpfx)libc% $(+postinit),$^) \ |
| 460 |
$(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit) |
461 |
$(link-extra-libs-static) $(link-libc-static) $(+postctorS) $(+postinit) |
| 461 |
endif |
462 |
endif |
| 462 |
# Command for statically linking bounded-pointer programs with the C library. |
463 |
# Command for statically linking bounded-pointer programs with the C library. |
| 463 |
ifndef +link-bounded |
464 |
ifndef +link-bounded |
| 464 |
+link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \ |
465 |
+link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \ |
| 465 |
$(sysdep-LDFLAGS) $(LDFLAGS) \ |
466 |
$(sysdep-LDFLAGS) $(LDFLAGS) \ |
| 466 |
$(addprefix $(csu-objpfx),b$(static-start-installed-name)) \ |
467 |
$(addprefix $(csu-objpfx),b$(static-start-installed-name)) \ |
| 467 |
$(+preinit) $(+prector) \ |
468 |
$(+preinit) $(+prectorS) \ |
| 468 |
$(filter-out $(addprefix $(csu-objpfx),start.ob \ |
469 |
$(filter-out $(addprefix $(csu-objpfx),start.ob \ |
| 469 |
$(start-installed-name))\ |
470 |
$(start-installed-name))\ |
| 470 |
$(+preinit) $(link-extra-libs-bounded) \ |
471 |
$(+preinit) $(link-extra-libs-bounded) \ |
| 471 |
$(common-objpfx)libc% $(+postinit),$^) \ |
472 |
$(common-objpfx)libc% $(+postinit),$^) \ |
| 472 |
$(link-extra-libs-bounded) $(link-libc-bounded) $(+postctor) $(+postinit) |
473 |
$(link-extra-libs-bounded) $(link-libc-bounded) $(+postctorS) $(+postinit) |
| 473 |
endif |
474 |
endif |
| 474 |
ifndef config-LDFLAGS |
475 |
ifndef config-LDFLAGS |
| 475 |
ifeq (yesyes,$(build-shared)$(elf)) |
476 |
ifeq (yesyes,$(build-shared)$(elf)) |