Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Efr32 gn build #1958

Merged
merged 6 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Disable -fPIC by default on embedded platforms
This was set in configure.ac as a default, but since embedded platforms
were always overriding CFLAGS that removed it. Fix this in GN so it only
applies to POSIX platforms.
  • Loading branch information
mspang authored and jepenven-silabs committed Aug 4, 2020
commit 7d4c3280cafadf4ad38e50a7783c98c5f884a43c
8 changes: 5 additions & 3 deletions gn/build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,14 @@ config("stack_protector_default") {
}

config("pic_default") {
cflags = [ "-fPIC" ]
ldflags = cflags
if (enable_pic) {
cflags = [ "-fPIC" ]
ldflags = cflags
}
}

config("pie_default") {
if (current_os == "linux") {
if (enable_pie) {
ldflags = [ "-pie" ]
}
}
Expand Down
6 changes: 6 additions & 0 deletions gn/build/config/compiler/compiler.gni
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,10 @@ declare_args() {

# Symbol level for debugging.
symbol_level = 2

# Enable position independent code (-fPIC).
enable_pic = current_os == "linux" || current_os == "mac"

# Enable position independent executables (-pie).
enable_pie = current_os == "linux"
}