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

gcc: pass hostEqualsTarget to builder #210097

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions pkgs/development/compilers/gcc/10/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ stdenv.mkDerivation ({
})
EXTRA_FLAGS_FOR_TARGET
EXTRA_LDFLAGS_FOR_TARGET
hostEqualsTarget
;

passthru = {
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/compilers/gcc/11/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ stdenv.mkDerivation ({
})
EXTRA_FLAGS_FOR_TARGET
EXTRA_LDFLAGS_FOR_TARGET
hostEqualsTarget
;

passthru = {
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/compilers/gcc/12/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ stdenv.mkDerivation ({
})
EXTRA_FLAGS_FOR_TARGET
EXTRA_LDFLAGS_FOR_TARGET
hostEqualsTarget
;

passthru = {
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/compilers/gcc/4.8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ stdenv.mkDerivation ({
})
EXTRA_FLAGS_FOR_TARGET
EXTRA_LDFLAGS_FOR_TARGET
hostEqualsTarget
;

passthru = {
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/compilers/gcc/4.9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ stdenv.mkDerivation ({
})
EXTRA_FLAGS_FOR_TARGET
EXTRA_LDFLAGS_FOR_TARGET
hostEqualsTarget
;

passthru = {
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/compilers/gcc/6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ stdenv.mkDerivation ({
})
EXTRA_FLAGS_FOR_TARGET
EXTRA_LDFLAGS_FOR_TARGET
hostEqualsTarget
;

passthru = {
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/compilers/gcc/7/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ stdenv.mkDerivation ({
})
EXTRA_FLAGS_FOR_TARGET
EXTRA_LDFLAGS_FOR_TARGET
hostEqualsTarget
;

passthru = {
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/compilers/gcc/8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ stdenv.mkDerivation ({
})
EXTRA_FLAGS_FOR_TARGET
EXTRA_LDFLAGS_FOR_TARGET
hostEqualsTarget
;

passthru = {
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/compilers/gcc/9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ stdenv.mkDerivation ({
})
EXTRA_FLAGS_FOR_TARGET
EXTRA_LDFLAGS_FOR_TARGET
hostEqualsTarget
;

passthru = {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ if test "$noSysDirs" = "1"; then
declare EXTRA_FLAGS${post}="${extraFlags[*]}"
done

if test -z "${targetConfig-}"; then
if test "$hostEqualsTarget" == 1; then
# host = target, so the flags are the same
EXTRA_FLAGS_FOR_TARGET="$EXTRA_FLAGS"
EXTRA_LDFLAGS_FOR_TARGET="$EXTRA_LDFLAGS"
Expand Down Expand Up @@ -128,7 +128,7 @@ if test "$noSysDirs" = "1"; then
"FLAGS_FOR_TARGET=$EXTRA_FLAGS_FOR_TARGET $EXTRA_LDFLAGS_FOR_TARGET"
)

if test -z "${targetConfig-}"; then
if test "$hostEqualsTarget" == 1; then
makeFlagsArray+=(
"BOOT_CFLAGS=$EXTRA_FLAGS $EXTRA_LDFLAGS"
"BOOT_LDFLAGS=$EXTRA_FLAGS_FOR_TARGET $EXTRA_LDFLAGS_FOR_TARGET"
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/compilers/gcc/common/extra-target-flags.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ let
in

{
hostEqualsTarget = stdenv.hostPlatform == stdenv.targetPlatform;

# For non-cross builds these flags are currently assigned in builder.sh.
# It would be good to consolidate the generation of makeFlags
# ({C,CXX,LD}FLAGS_FOR_{BUILD,TARGET}, etc...) at some point.
Expand Down