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

run-make-support: preserve tooks.mk behavior for EXTRACXXFLAGS #124594

Merged
merged 1 commit into from
May 3, 2024

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented May 1, 2024

In #123149 when trying to add a command wrapper for cc, I didn't preserve the behavior of tools.mk completely: tools.mk had

# Extra flags needed to compile a working executable with the standard library
ifdef IS_WINDOWS
ifdef IS_MSVC
	#EXTRACFLAGS := ws2_32.lib userenv.lib advapi32.lib bcrypt.lib ntdll.lib synchronization.lib
else
	#EXTRACFLAGS := -lws2_32 -luserenv -lbcrypt -lntdll -lsynchronization
	EXTRACXXFLAGS := -lstdc++
	#EXTRARSCXXFLAGS := -l static:-bundle=stdc++
endif
else
ifeq ($(UNAME),Darwin)
	#EXTRACFLAGS := -lresolv
	EXTRACXXFLAGS := -lc++
	#EXTRARSCXXFLAGS := -lc++
else
ifeq ($(UNAME),FreeBSD)
	#EXTRACFLAGS := -lm -lpthread -lgcc_s
else
ifeq ($(UNAME),SunOS)
	#EXTRACFLAGS := -lm -lpthread -lposix4 -lsocket -lresolv
else
ifeq ($(UNAME),OpenBSD)
	#EXTRACFLAGS := -lm -lpthread -lc++abi
	#RUSTC := $(RUSTC) -C linker="$(word 1,$(CC:ccache=))"
else
	#EXTRACFLAGS := -lm -lrt -ldl -lpthread
	EXTRACXXFLAGS := -lstdc++
	#EXTRARSCXXFLAGS := -lstdc++
endif
endif
endif
endif
endif

Note that for {FreeBSD, SunOs, OpenBSD} the -lstdc++ flag is not passed, so EXTRACXXFLAGS for those platforms should be an empty vec![].

r? ghost (testing this with PR CI)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels May 1, 2024
@rust-cloud-vms rust-cloud-vms bot force-pushed the rmake-cc branch 3 times, most recently from 357d412 to c002eff Compare May 1, 2024 20:06
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the rmake-cc branch 2 times, most recently from da9f1dd to 6834063 Compare May 2, 2024 00:18
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels May 2, 2024
@jieyouxu
Copy link
Member Author

jieyouxu commented May 2, 2024

r? compiler

@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu marked this pull request as draft May 2, 2024 01:01
@jieyouxu
Copy link
Member Author

jieyouxu commented May 2, 2024

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 2, 2024
@jieyouxu jieyouxu marked this pull request as ready for review May 2, 2024 13:15
@jieyouxu
Copy link
Member Author

jieyouxu commented May 2, 2024

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 2, 2024
Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fmease
Copy link
Member

fmease commented May 3, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 3, 2024

📌 Commit 42ecde4 has been approved by fmease

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 3, 2024
fmease added a commit to fmease/rust that referenced this pull request May 3, 2024
run-make-support: preserve tooks.mk behavior for EXTRACXXFLAGS

In rust-lang#123149 when trying to add a command wrapper for `cc`, I didn't preserve the behavior of tools.mk completely: tools.mk had

```makefile
# Extra flags needed to compile a working executable with the standard library
ifdef IS_WINDOWS
ifdef IS_MSVC
	#EXTRACFLAGS := ws2_32.lib userenv.lib advapi32.lib bcrypt.lib ntdll.lib synchronization.lib
else
	#EXTRACFLAGS := -lws2_32 -luserenv -lbcrypt -lntdll -lsynchronization
	EXTRACXXFLAGS := -lstdc++
	#EXTRARSCXXFLAGS := -l static:-bundle=stdc++
endif
else
ifeq ($(UNAME),Darwin)
	#EXTRACFLAGS := -lresolv
	EXTRACXXFLAGS := -lc++
	#EXTRARSCXXFLAGS := -lc++
else
ifeq ($(UNAME),FreeBSD)
	#EXTRACFLAGS := -lm -lpthread -lgcc_s
else
ifeq ($(UNAME),SunOS)
	#EXTRACFLAGS := -lm -lpthread -lposix4 -lsocket -lresolv
else
ifeq ($(UNAME),OpenBSD)
	#EXTRACFLAGS := -lm -lpthread -lc++abi
	#RUSTC := $(RUSTC) -C linker="$(word 1,$(CC:ccache=))"
else
	#EXTRACFLAGS := -lm -lrt -ldl -lpthread
	EXTRACXXFLAGS := -lstdc++
	#EXTRARSCXXFLAGS := -lstdc++
endif
endif
endif
endif
endif
```

Note that for {`FreeBSD`, `SunOs`, `OpenBSD`} the `-lstdc++` flag is *not* passed, so `EXTRACXXFLAGS` for those platforms should be an empty `vec![]`.

r? ghost (testing this with PR CI)
fmease added a commit to fmease/rust that referenced this pull request May 3, 2024
run-make-support: preserve tooks.mk behavior for EXTRACXXFLAGS

In rust-lang#123149 when trying to add a command wrapper for `cc`, I didn't preserve the behavior of tools.mk completely: tools.mk had

```makefile
# Extra flags needed to compile a working executable with the standard library
ifdef IS_WINDOWS
ifdef IS_MSVC
	#EXTRACFLAGS := ws2_32.lib userenv.lib advapi32.lib bcrypt.lib ntdll.lib synchronization.lib
else
	#EXTRACFLAGS := -lws2_32 -luserenv -lbcrypt -lntdll -lsynchronization
	EXTRACXXFLAGS := -lstdc++
	#EXTRARSCXXFLAGS := -l static:-bundle=stdc++
endif
else
ifeq ($(UNAME),Darwin)
	#EXTRACFLAGS := -lresolv
	EXTRACXXFLAGS := -lc++
	#EXTRARSCXXFLAGS := -lc++
else
ifeq ($(UNAME),FreeBSD)
	#EXTRACFLAGS := -lm -lpthread -lgcc_s
else
ifeq ($(UNAME),SunOS)
	#EXTRACFLAGS := -lm -lpthread -lposix4 -lsocket -lresolv
else
ifeq ($(UNAME),OpenBSD)
	#EXTRACFLAGS := -lm -lpthread -lc++abi
	#RUSTC := $(RUSTC) -C linker="$(word 1,$(CC:ccache=))"
else
	#EXTRACFLAGS := -lm -lrt -ldl -lpthread
	EXTRACXXFLAGS := -lstdc++
	#EXTRARSCXXFLAGS := -lstdc++
endif
endif
endif
endif
endif
```

Note that for {`FreeBSD`, `SunOs`, `OpenBSD`} the `-lstdc++` flag is *not* passed, so `EXTRACXXFLAGS` for those platforms should be an empty `vec![]`.

r? ghost (testing this with PR CI)
bors added a commit to rust-lang-ci/rust that referenced this pull request May 3, 2024
Rollup of 8 pull requests

Successful merges:

 - rust-lang#124412 (io safety: update Unix explanation to use `Arc`)
 - rust-lang#124441 (String.truncate comment microfix (greater or equal))
 - rust-lang#124594 (run-make-support: preserve tooks.mk behavior for EXTRACXXFLAGS)
 - rust-lang#124604 (library/std: Remove unused `gimli-symbolize` feature)
 - rust-lang#124607 (`rustc_expand` cleanups)
 - rust-lang#124609 (variable-precision float operations can differ depending on optimization levels)
 - rust-lang#124610 (Tweak `consts_may_unify`)
 - rust-lang#124612 (Add support for inputing via stdin with run-make-support)

r? `@ghost`
`@rustbot` modify labels: rollup
fmease added a commit to fmease/rust that referenced this pull request May 3, 2024
run-make-support: preserve tooks.mk behavior for EXTRACXXFLAGS

In rust-lang#123149 when trying to add a command wrapper for `cc`, I didn't preserve the behavior of tools.mk completely: tools.mk had

```makefile
# Extra flags needed to compile a working executable with the standard library
ifdef IS_WINDOWS
ifdef IS_MSVC
	#EXTRACFLAGS := ws2_32.lib userenv.lib advapi32.lib bcrypt.lib ntdll.lib synchronization.lib
else
	#EXTRACFLAGS := -lws2_32 -luserenv -lbcrypt -lntdll -lsynchronization
	EXTRACXXFLAGS := -lstdc++
	#EXTRARSCXXFLAGS := -l static:-bundle=stdc++
endif
else
ifeq ($(UNAME),Darwin)
	#EXTRACFLAGS := -lresolv
	EXTRACXXFLAGS := -lc++
	#EXTRARSCXXFLAGS := -lc++
else
ifeq ($(UNAME),FreeBSD)
	#EXTRACFLAGS := -lm -lpthread -lgcc_s
else
ifeq ($(UNAME),SunOS)
	#EXTRACFLAGS := -lm -lpthread -lposix4 -lsocket -lresolv
else
ifeq ($(UNAME),OpenBSD)
	#EXTRACFLAGS := -lm -lpthread -lc++abi
	#RUSTC := $(RUSTC) -C linker="$(word 1,$(CC:ccache=))"
else
	#EXTRACFLAGS := -lm -lrt -ldl -lpthread
	EXTRACXXFLAGS := -lstdc++
	#EXTRARSCXXFLAGS := -lstdc++
endif
endif
endif
endif
endif
```

Note that for {`FreeBSD`, `SunOs`, `OpenBSD`} the `-lstdc++` flag is *not* passed, so `EXTRACXXFLAGS` for those platforms should be an empty `vec![]`.

r? ghost (testing this with PR CI)
bors added a commit to rust-lang-ci/rust that referenced this pull request May 3, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#124441 (String.truncate comment microfix (greater or equal))
 - rust-lang#124594 (run-make-support: preserve tooks.mk behavior for EXTRACXXFLAGS)
 - rust-lang#124604 (library/std: Remove unused `gimli-symbolize` feature)
 - rust-lang#124607 (`rustc_expand` cleanups)
 - rust-lang#124609 (variable-precision float operations can differ depending on optimization levels)
 - rust-lang#124610 (Tweak `consts_may_unify`)
 - rust-lang#124637 (AST pretty: Use `builtin_syntax` for type ascription)

Failed merges:

 - rust-lang#124638 (Move some tests from `rustc_expand` to `rustc_parse`.)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request May 3, 2024
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#123480 (deref patterns: impl `DerefPure` for more std types)
 - rust-lang#124412 (io safety: update Unix explanation to use `Arc`)
 - rust-lang#124441 (String.truncate comment microfix (greater or equal))
 - rust-lang#124594 (run-make-support: preserve tooks.mk behavior for EXTRACXXFLAGS)
 - rust-lang#124604 (library/std: Remove unused `gimli-symbolize` feature)
 - rust-lang#124607 (`rustc_expand` cleanups)
 - rust-lang#124609 (variable-precision float operations can differ depending on optimization levels)
 - rust-lang#124610 (Tweak `consts_may_unify`)
 - rust-lang#124626 (const_eval_select: add tracking issue)
 - rust-lang#124637 (AST pretty: Use `builtin_syntax` for type ascription)

Failed merges:

 - rust-lang#124638 (Move some tests from `rustc_expand` to `rustc_parse`.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 30efce9 into rust-lang:master May 3, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 3, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 3, 2024
Rollup merge of rust-lang#124594 - jieyouxu:rmake-cc, r=fmease

run-make-support: preserve tooks.mk behavior for EXTRACXXFLAGS

In rust-lang#123149 when trying to add a command wrapper for `cc`, I didn't preserve the behavior of tools.mk completely: tools.mk had

```makefile
# Extra flags needed to compile a working executable with the standard library
ifdef IS_WINDOWS
ifdef IS_MSVC
	#EXTRACFLAGS := ws2_32.lib userenv.lib advapi32.lib bcrypt.lib ntdll.lib synchronization.lib
else
	#EXTRACFLAGS := -lws2_32 -luserenv -lbcrypt -lntdll -lsynchronization
	EXTRACXXFLAGS := -lstdc++
	#EXTRARSCXXFLAGS := -l static:-bundle=stdc++
endif
else
ifeq ($(UNAME),Darwin)
	#EXTRACFLAGS := -lresolv
	EXTRACXXFLAGS := -lc++
	#EXTRARSCXXFLAGS := -lc++
else
ifeq ($(UNAME),FreeBSD)
	#EXTRACFLAGS := -lm -lpthread -lgcc_s
else
ifeq ($(UNAME),SunOS)
	#EXTRACFLAGS := -lm -lpthread -lposix4 -lsocket -lresolv
else
ifeq ($(UNAME),OpenBSD)
	#EXTRACFLAGS := -lm -lpthread -lc++abi
	#RUSTC := $(RUSTC) -C linker="$(word 1,$(CC:ccache=))"
else
	#EXTRACFLAGS := -lm -lrt -ldl -lpthread
	EXTRACXXFLAGS := -lstdc++
	#EXTRARSCXXFLAGS := -lstdc++
endif
endif
endif
endif
endif
```

Note that for {`FreeBSD`, `SunOs`, `OpenBSD`} the `-lstdc++` flag is *not* passed, so `EXTRACXXFLAGS` for those platforms should be an empty `vec![]`.

r? ghost (testing this with PR CI)
@RalfJung
Copy link
Member

RalfJung commented May 3, 2024

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants