Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250747
b: refs/heads/master
c: 40df759
h: refs/heads/master
i:
  250745: 730325e
  250743: e8274e6
v: v3
  • Loading branch information
Michal Marek committed Apr 20, 2011
1 parent b60f333 commit 18faf9f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a8b8017c34fefcb763d8b06c294b58d1c480b2e4
refs/heads/master: 40df759e2b9ec945f1a5ddc61b3fdfbb6583257e
5 changes: 5 additions & 0 deletions trunk/Documentation/kbuild/makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,11 @@ When kbuild executes, the following steps are followed (roughly):
used when linking modules. This is often a linker script.
From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).

KBUILD_ARFLAGS Options for $(AR) when creating archives

$(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
mode) if this option is supported by $(AR).

--- 6.2 Add prerequisites to archprepare:

The archprepare: rule is used to list prerequisites that need to be
Expand Down
4 changes: 4 additions & 0 deletions trunk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
export KBUILD_ARFLAGS

# When compiling out-of-tree modules, put MODVERDIR in the module
# tree rather than in the kernel tree. The kernel tree might
Expand Down Expand Up @@ -612,6 +613,9 @@ KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
# conserve stack if available
KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)

# use the deterministic mode of AR if available
KBUILD_ARFLAGS := $(call ar-option,D)

# check for 'asm goto'
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y)
KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
Expand Down
5 changes: 5 additions & 0 deletions trunk/scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ cc-ldoption = $(call try-run,\
ld-option = $(call try-run,\
$(CC) /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2))

# ar-option
# Usage: KBUILD_ARFLAGS := $(call ar-option,D)
# Important: no spaces around options
ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))

######

###
Expand Down
4 changes: 2 additions & 2 deletions trunk/scripts/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ quiet_cmd_link_o_target = LD $@
cmd_link_o_target = $(if $(strip $(obj-y)),\
$(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \
$(cmd_secanalysis),\
rm -f $@; $(AR) rcsD $@)
rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@)

$(builtin-target): $(obj-y) FORCE
$(call if_changed,link_o_target)
Expand All @@ -371,7 +371,7 @@ $(modorder-target): $(subdir-ym) FORCE
#
ifdef lib-target
quiet_cmd_link_l_target = AR $@
cmd_link_l_target = rm -f $@; $(AR) rcsD $@ $(lib-y)
cmd_link_l_target = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib-y)

$(lib-target): $(lib-y) FORCE
$(call if_changed,link_l_target)
Expand Down

0 comments on commit 18faf9f

Please sign in to comment.