Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
ff5b1ce6
Commit
ff5b1ce6
authored
Dec 11, 2016
by
Michal Marek
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'kbuild/rc-fixes' into kbuild/misc
parents
d1e774f4
152b695d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
10 deletions
+81
-10
Makefile
Makefile
+3
-2
arch/x86/purgatory/Makefile
arch/x86/purgatory/Makefile
+1
-0
scripts/Makefile.build
scripts/Makefile.build
+75
-6
scripts/gcc-x86_64-has-stack-protector.sh
scripts/gcc-x86_64-has-stack-protector.sh
+1
-1
scripts/package/builddeb
scripts/package/builddeb
+1
-1
No files found.
Makefile
View file @
ff5b1ce6
...
@@ -399,11 +399,12 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
...
@@ -399,11 +399,12 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing
-fno-common
\
-fno-strict-aliasing
-fno-common
\
-Werror-implicit-function-declaration
\
-Werror-implicit-function-declaration
\
-Wno-format-security
\
-Wno-format-security
\
-std
=
gnu89
-std
=
gnu89
$(
call
cc-option,-fno-PIE
)
KBUILD_AFLAGS_KERNEL
:=
KBUILD_AFLAGS_KERNEL
:=
KBUILD_CFLAGS_KERNEL
:=
KBUILD_CFLAGS_KERNEL
:=
KBUILD_AFLAGS
:=
-D__ASSEMBLY__
KBUILD_AFLAGS
:=
-D__ASSEMBLY__
$(
call
cc-option,-fno-PIE
)
KBUILD_AFLAGS_MODULE
:=
-DMODULE
KBUILD_AFLAGS_MODULE
:=
-DMODULE
KBUILD_CFLAGS_MODULE
:=
-DMODULE
KBUILD_CFLAGS_MODULE
:=
-DMODULE
KBUILD_LDFLAGS_MODULE
:=
-T
$(srctree)
/scripts/module-common.lds
KBUILD_LDFLAGS_MODULE
:=
-T
$(srctree)
/scripts/module-common.lds
...
...
arch/x86/purgatory/Makefile
View file @
ff5b1ce6
...
@@ -16,6 +16,7 @@ KCOV_INSTRUMENT := n
...
@@ -16,6 +16,7 @@ KCOV_INSTRUMENT := n
KBUILD_CFLAGS
:=
-fno-strict-aliasing
-Wall
-Wstrict-prototypes
-fno-zero-initialized-in-bss
-fno-builtin
-ffreestanding
-c
-MD
-Os
-mcmodel
=
large
KBUILD_CFLAGS
:=
-fno-strict-aliasing
-Wall
-Wstrict-prototypes
-fno-zero-initialized-in-bss
-fno-builtin
-ffreestanding
-c
-MD
-Os
-mcmodel
=
large
KBUILD_CFLAGS
+=
-m
$(BITS)
KBUILD_CFLAGS
+=
-m
$(BITS)
KBUILD_CFLAGS
+=
$(
call
cc-option,-fno-PIE
)
$(obj)/purgatory.ro
:
$(PURGATORY_OBJS) FORCE
$(obj)/purgatory.ro
:
$(PURGATORY_OBJS) FORCE
$(
call
if_changed,ld
)
$(
call
if_changed,ld
)
...
...
scripts/Makefile.build
View file @
ff5b1ce6
...
@@ -159,7 +159,8 @@ cmd_cpp_i_c = $(CPP) $(c_flags) -o $@ $<
...
@@ -159,7 +159,8 @@ cmd_cpp_i_c = $(CPP) $(c_flags) -o $@ $<
$(obj)/%.i
:
$(src)/%.c FORCE
$(obj)/%.i
:
$(src)/%.c FORCE
$(
call
if_changed_dep,cpp_i_c
)
$(
call
if_changed_dep,cpp_i_c
)
cmd_gensymtypes
=
\
# These mirror gensymtypes_S and co below, keep them in synch.
cmd_gensymtypes_c
=
\
$(CPP)
-D__GENKSYMS__
$(c_flags)
$<
|
\
$(CPP)
-D__GENKSYMS__
$(c_flags)
$<
|
\
$(GENKSYMS)
$(
if
$(1)
,
-T
$(2)
)
\
$(GENKSYMS)
$(
if
$(1)
,
-T
$(2)
)
\
$(
patsubst
y,-s _,
$(CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX)
)
\
$(
patsubst
y,-s _,
$(CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX)
)
\
...
@@ -169,7 +170,7 @@ cmd_gensymtypes = \
...
@@ -169,7 +170,7 @@ cmd_gensymtypes = \
quiet_cmd_cc_symtypes_c
=
SYM
$(quiet_modtag)
$@
quiet_cmd_cc_symtypes_c
=
SYM
$(quiet_modtag)
$@
cmd_cc_symtypes_c
=
\
cmd_cc_symtypes_c
=
\
set
-e
;
\
set
-e
;
\
$(
call
cmd_gensymtypes
,true,
$@
)
>
/dev/null
;
\
$(
call
cmd_gensymtypes
_c,true,
$@
)
>
/dev/null
;
\
test
-s
$@
||
rm
-f
$@
test
-s
$@
||
rm
-f
$@
$(obj)/%.symtypes
:
$(src)/%.c FORCE
$(obj)/%.symtypes
:
$(src)/%.c FORCE
...
@@ -198,9 +199,10 @@ else
...
@@ -198,9 +199,10 @@ else
# the actual value of the checksum generated by genksyms
# the actual value of the checksum generated by genksyms
cmd_cc_o_c
=
$(CC)
$(c_flags)
-c
-o
$
(
@D
)
/.tmp_
$
(
@F
)
$<
cmd_cc_o_c
=
$(CC)
$(c_flags)
-c
-o
$
(
@D
)
/.tmp_
$
(
@F
)
$<
cmd_modversions
=
\
cmd_modversions_c
=
\
if
$(OBJDUMP)
-h
$
(
@D
)
/.tmp_
$
(
@F
)
|
grep
-q
__ksymtab
;
then
\
if
$(OBJDUMP)
-h
$
(
@D
)
/.tmp_
$
(
@F
)
|
grep
-q
__ksymtab
;
then
\
$(
call
cmd_gensymtypes,
$(KBUILD_SYMTYPES)
,
$
(
@:.o
=
.symtypes
))
\
$(
call
cmd_gensymtypes
_c
,
$(KBUILD_SYMTYPES)
,
$
(
@:.o
=
.symtypes
))
\
>
$
(
@D
)
/.tmp_
$
(
@F:.o
=
.ver
)
;
\
>
$
(
@D
)
/.tmp_
$
(
@F:.o
=
.ver
)
;
\
\
\
$(LD)
$(LDFLAGS)
-r
-o
$@
$
(
@D
)
/.tmp_
$
(
@F
)
\
$(LD)
$(LDFLAGS)
-r
-o
$@
$
(
@D
)
/.tmp_
$
(
@F
)
\
...
@@ -268,13 +270,14 @@ endif # CONFIG_STACK_VALIDATION
...
@@ -268,13 +270,14 @@ endif # CONFIG_STACK_VALIDATION
define
rule_cc_o_c
define
rule_cc_o_c
$(call
echo-cmd,checksrc)
$(cmd_checksrc)
\
$(call
echo-cmd,checksrc)
$(cmd_checksrc)
\
$(call
cmd_and_fixdep,cc_o_c)
\
$(call
cmd_and_fixdep,cc_o_c)
\
$(cmd_modversions)
\
$(cmd_modversions
_c
)
\
$(cmd_objtool)
\
$(cmd_objtool)
\
$(call
echo-cmd,record_mcount)
$(cmd_record_mcount)
$(call
echo-cmd,record_mcount)
$(cmd_record_mcount)
endef
endef
define
rule_as_o_S
define
rule_as_o_S
$(call
cmd_and_fixdep,as_o_S)
\
$(call
cmd_and_fixdep,as_o_S)
\
$(cmd_modversions_S)
\
$(cmd_objtool)
$(cmd_objtool)
endef
endef
...
@@ -314,6 +317,39 @@ modkern_aflags := $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL)
...
@@ -314,6 +317,39 @@ modkern_aflags := $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL)
$(real-objs-m)
:
modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
$(real-objs-m)
:
modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
$(real-objs-m
:
.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
$(real-objs-m
:
.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
# .S file exports must have their C prototypes defined in asm/asm-prototypes.h
# or a file that it includes, in order to get versioned symbols. We build a
# dummy C file that includes asm-prototypes and the EXPORT_SYMBOL lines from
# the .S file (with trailing ';'), and run genksyms on that, to extract vers.
#
# This is convoluted. The .S file must first be preprocessed to run guards and
# expand names, then the resulting exports must be constructed into plain
# EXPORT_SYMBOL(symbol); to build our dummy C file, and that gets preprocessed
# to make the genksyms input.
#
# These mirror gensymtypes_c and co above, keep them in synch.
cmd_gensymtypes_S
=
\
(
echo
"
\#
include <linux/kernel.h>"
;
\
echo
"
\#
include <asm/asm-prototypes.h>"
;
\
$(CPP)
$(a_flags)
$<
|
\
grep
"
\<
___EXPORT_SYMBOL
\>
"
|
\
sed
's/.*___EXPORT_SYMBOL[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*,.*/EXPORT_SYMBOL(\1);/'
)
|
\
$(CPP)
-D__GENKSYMS__
$(c_flags)
-xc
- |
\
$(GENKSYMS)
$(
if
$(1)
,
-T
$(2)
)
\
$(
patsubst
y,-s _,
$(CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX)
)
\
$(
if
$(KBUILD_PRESERVE)
,-p
)
\
-r
$(
firstword
$(
wildcard
$(2:.symtypes=.symref)
/dev/null
))
quiet_cmd_cc_symtypes_S
=
SYM
$(quiet_modtag)
$@
cmd_cc_symtypes_S
=
\
set
-e
;
\
$(
call
cmd_gensymtypes_S,true,
$@
)
>
/dev/null
;
\
test
-s
$@
||
rm
-f
$@
$(obj)/%.symtypes
:
$(src)/%.S FORCE
$(
call
cmd,cc_symtypes_S
)
quiet_cmd_cpp_s_S
=
CPP
$(quiet_modtag)
$@
quiet_cmd_cpp_s_S
=
CPP
$(quiet_modtag)
$@
cmd_cpp_s_S
=
$(CPP)
$(a_flags)
-o
$@
$<
cmd_cpp_s_S
=
$(CPP)
$(a_flags)
-o
$@
$<
...
@@ -321,7 +357,37 @@ $(obj)/%.s: $(src)/%.S FORCE
...
@@ -321,7 +357,37 @@ $(obj)/%.s: $(src)/%.S FORCE
$(
call
if_changed_dep,cpp_s_S
)
$(
call
if_changed_dep,cpp_s_S
)
quiet_cmd_as_o_S
=
AS
$(quiet_modtag)
$@
quiet_cmd_as_o_S
=
AS
$(quiet_modtag)
$@
cmd_as_o_S
=
$(CC)
$(a_flags)
-c
-o
$@
$<
ifndef
CONFIG_MODVERSIONS
cmd_as_o_S
=
$(CC)
$(a_flags)
-c
-o
$@
$<
else
ASM_PROTOTYPES
:=
$(
wildcard
$(srctree)
/arch/
$(SRCARCH)
/include/asm/asm-prototypes.h
)
ifeq
($(ASM_PROTOTYPES),)
cmd_as_o_S
=
$(CC)
$(a_flags)
-c
-o
$@
$<
else
# versioning matches the C process described above, with difference that
# we parse asm-prototypes.h C header to get function definitions.
cmd_as_o_S
=
$(CC)
$(a_flags)
-c
-o
$
(
@D
)
/.tmp_
$
(
@F
)
$<
cmd_modversions_S
=
\
if
$(OBJDUMP)
-h
$
(
@D
)
/.tmp_
$
(
@F
)
|
grep
-q
__ksymtab
;
then
\
$(
call
cmd_gensymtypes_S,
$(KBUILD_SYMTYPES)
,
$
(
@:.o
=
.symtypes
))
\
>
$
(
@D
)
/.tmp_
$
(
@F:.o
=
.ver
)
;
\
\
$(LD)
$(LDFLAGS)
-r
-o
$@
$
(
@D
)
/.tmp_
$
(
@F
)
\
-T
$
(
@D
)
/.tmp_
$
(
@F:.o
=
.ver
)
;
\
rm
-f
$
(
@D
)
/.tmp_
$
(
@F
)
$
(
@D
)
/.tmp_
$
(
@F:.o
=
.ver
)
;
\
else
\
mv
-f
$
(
@D
)
/.tmp_
$
(
@F
)
$@
;
\
fi
;
endif
endif
$(obj)/%.o
:
$(src)/%.S $(objtool_obj) FORCE
$(obj)/%.o
:
$(src)/%.S $(objtool_obj) FORCE
$(
call
if_changed_rule,as_o_S
)
$(
call
if_changed_rule,as_o_S
)
...
@@ -430,6 +496,9 @@ cmd_export_list = $(OBJDUMP) -h $< | \
...
@@ -430,6 +496,9 @@ cmd_export_list = $(OBJDUMP) -h $< | \
$(obj)/lib-ksyms.o
:
$(lib-target) FORCE
$(obj)/lib-ksyms.o
:
$(lib-target) FORCE
$(
call
if_changed,export_list
)
$(
call
if_changed,export_list
)
targets
+=
$(obj)
/lib-ksyms.o
endif
endif
#
#
...
...
scripts/gcc-x86_64-has-stack-protector.sh
View file @
ff5b1ce6
#!/bin/sh
#!/bin/sh
echo
"int foo(void) { char X[200]; return 3; }"
|
$*
-S
-x
c
-c
-O0
-mcmodel
=
kernel
-fstack-protector
-
-o
- 2> /dev/null |
grep
-q
"%gs"
echo
"int foo(void) { char X[200]; return 3; }"
|
$*
-S
-x
c
-c
-O0
-mcmodel
=
kernel
-f
no-PIE
-f
stack-protector
-
-o
- 2> /dev/null |
grep
-q
"%gs"
if
[
"
$?
"
-eq
"0"
]
;
then
if
[
"
$?
"
-eq
"0"
]
;
then
echo
y
echo
y
else
else
...
...
scripts/package/builddeb
View file @
ff5b1ce6
...
@@ -51,7 +51,7 @@ set_debarch() {
...
@@ -51,7 +51,7 @@ set_debarch() {
debarch
=
hppa
;;
debarch
=
hppa
;;
mips
*
)
mips
*
)
debarch
=
mips
$(
grep
-q
CPU_LITTLE_ENDIAN
=
y
$KCONFIG_CONFIG
&&
echo
el
||
true
)
;;
debarch
=
mips
$(
grep
-q
CPU_LITTLE_ENDIAN
=
y
$KCONFIG_CONFIG
&&
echo
el
||
true
)
;;
arm64
)
a
arch64|a
rm64
)
debarch
=
arm64
;;
debarch
=
arm64
;;
arm
*
)
arm
*
)
if
grep
-q
CONFIG_AEABI
=
y
$KCONFIG_CONFIG
;
then
if
grep
-q
CONFIG_AEABI
=
y
$KCONFIG_CONFIG
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment