Skip to content

Update configure #1735

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

Merged
merged 1 commit into from
Jul 15, 2025
Merged

Update configure #1735

merged 1 commit into from
Jul 15, 2025

Conversation

TelGome
Copy link
Contributor

@TelGome TelGome commented Jun 19, 2025

Since the patch "RISC-V: Add generic tune as default" has been commited into the trunk, the configure should also been updated. Here is the link: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=20f593018519fec1602dc39c08ba2e674a2d8a1c

@kito-cheng
Copy link
Collaborator

This will break riscv-gnu-toolchain with existing GCC release since we don't have -mtune=generic until we have GCC 16

@TelGome
Copy link
Contributor Author

TelGome commented Jun 19, 2025

This will break riscv-gnu-toolchain with existing GCC release since we don't have -mtune=generic until we have GCC 16

OKay, I get it. Thanks.

@kito-cheng
Copy link
Collaborator

I guess we may adjust configure script and Makefile a little bit more to make it don't pass --with-tune if user didn't explicitly specify that when configure riscv-gnu-toolchain, so that we can use the real default value in GCC?

@cmuellner
Copy link
Collaborator

I guess we may adjust configure script and Makefile a little bit more to make it don't pass --with-tune if user didn't explicitly specify that when configure riscv-gnu-toolchain, so that we can use the real default value in GCC?

@TelGome, are you interested in working on that?

@TelGome
Copy link
Contributor Author

TelGome commented Jul 4, 2025

@TelGome, are you interested in working on that?

Yes, and I will modify the code later.

@TelGome
Copy link
Contributor Author

TelGome commented Jul 4, 2025

Hi @kito-cheng @cmuellner , the code has been updated. Could you please review it again when you have time? Thanks!

configure.ac Outdated
)

if test -n "$with_tune" && test "$with_tune" != "yes"; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is usually done like this: test "x$with_tune" != "xyes".
But here this might be a better fit: test "x$with_tune" != "x".

Makefile.in Outdated
@@ -35,7 +35,7 @@ endif

WITH_ARCH ?= @WITH_ARCH@
WITH_ABI ?= @WITH_ABI@
WITH_TUNE ?= @WITH_TUNE@
WITH_TUNE = @WITH_TUNE@
Copy link
Collaborator

Choose a reason for hiding this comment

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

Keep this unchanged, ?= means only assign that when that variable is undefined - that allow user to override that, although it still override-able for =, but keep it ?= is kind of more explicitly to say this is override-able

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If i keep WITH_TUNE ?= @WITH_TUNE@, no "WITH_TUNE=" appear in the Makefile.

image

Copy link
Collaborator

Choose a reason for hiding this comment

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

If i keep WITH_TUNE ?= @WITH_TUNE@, no "WITH_TUNE=" appear in the Makefile.

Shouldn't it be set by the configure script as modified by this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What you said is completely correct, and I will push the code later. Thanks.

@kito-cheng kito-cheng requested a review from Copilot July 7, 2025 13:04
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the RISC-V --with-tune handling in configure.ac, the generated configure script, and Makefile.in so that the default tune is now “generic” (GCC’s default) rather than “rocket”.

  • Change default --with-tune help text and remove the hardcoded “rocket” default.
  • Add conditional logic to only set WITH_TUNE when a non-yes value is provided.
  • Adjust Makefile.in to unconditionally assign WITH_TUNE from the generated configure variable.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
configure.ac Updated --with-tune help string, removed default action, added conditional WITH_TUNE logic, and simplified AC_SUBST.
configure Updated usage text, removed old default assignment, and added new WITH_TUNE conditional block.
Makefile.in Changed WITH_TUNE ?= @WITH_TUNE@ to WITH_TUNE = @WITH_TUNE@ for direct assignment.
Comments suppressed due to low confidence (2)

configure.ac:97

  • [nitpick] The help text 'defaults to GCC's default' is somewhat vague; consider stating 'defaults to generic' explicitly so users immediately see the actual value.
	[AS_HELP_STRING([--with-tune=generic],

Makefile.in:38

  • [nitpick] Switching from '?=' to '=' means environment variables can no longer override WITH_TUNE; if you still want to allow user overrides via the environment, consider using '?=' instead of '='.
WITH_TUNE = @WITH_TUNE@

Since the patch "RISC-V: Add generic tune as default" has been commited into the trunk, the configure should also been updated. Here is the link:
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=20f593018519fec1602dc39c08ba2e674a2d8a1c

Signed-off-by: TelGome <93700071+TelGome@users.noreply.github.com>
WITH_TUNE="--with-tune=$with_tune"
else
WITH_TUNE=""

Copy link
Collaborator

Choose a reason for hiding this comment

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

This empty line is not needed.

@cmuellner cmuellner merged commit b683d4d into riscv-collab:master Jul 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants