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

Make -fPIC configurable #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ compile_commands.json
# Entries below this point are managed by Please (DO NOT EDIT)
plz-out
.plzconfig.local

.idea
8 changes: 4 additions & 4 deletions .plzconfig
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ Inherit = true

[PluginConfig "default_opt_cflags"]
ConfigKey = DefaultOptCFlags
DefaultValue = --std=c99 -O3 -pipe -DNDEBUG -Wall -Werror
DefaultValue = --std=c99 -O3 -pipe -DNDEBUG -Wall -Werror -fPIC
Inherit = true

[PluginConfig "default_dbg_cflags"]
ConfigKey = DefaultDbgCFlags
DefaultValue = --std=c99 -g3 -pipe -DDEBUG -Wall -Werror
DefaultValue = --std=c99 -g3 -pipe -DDEBUG -Wall -Werror -fPIC
Inherit = true

[PluginConfig "default_opt_cppflags"]
ConfigKey = DefaultOptCppFlags
DefaultValue = --std=c++11 -O3 -pipe -DNDEBUG -Wall -Werror
DefaultValue = --std=c++11 -O3 -pipe -DNDEBUG -Wall -Werror -fPIC
Inherit = true

[PluginConfig "default_dbg_cppflags"]
ConfigKey = DefaultDbgCppFlags
DefaultValue = --std=c++11 -g3 -pipe -DDEBUG -Wall -Werror
DefaultValue = --std=c++11 -g3 -pipe -DDEBUG -Wall -Werror -fPIC
Inherit = true

[PluginConfig "default_ldflags"]
Expand Down
2 changes: 1 addition & 1 deletion build_defs/cc.build_defs
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ def _default_cflags(c, dbg):

def _build_flags(compiler_flags:list, pkg_config_libs:list, pkg_config_cflags:list, defines=None, c=False, dbg=False):
"""Builds flags that we'll pass to the compiler invocation."""
compiler_flags = [_default_cflags(c, dbg), '-fPIC'] + compiler_flags # N.B. order is important!
compiler_flags = [_default_cflags(c, dbg)] + compiler_flags
if defines:
compiler_flags += ['-D' + define for define in defines]

Expand Down