Skip to content

fix: linux cross-build require CFLAGS_FOR_BUILD#30

Merged
jiegec merged 1 commit into
TermonyHQ:masterfrom
SolidFaker:master
Jun 16, 2025
Merged

fix: linux cross-build require CFLAGS_FOR_BUILD#30
jiegec merged 1 commit into
TermonyHQ:masterfrom
SolidFaker:master

Conversation

@SolidFaker

Copy link
Copy Markdown
Contributor

building bash-5.2 on linux leads to these errors, see this issue.

adding CFLAGS_FOR_BUILD := -std=gnu17 works for me.

@jiegec

jiegec commented Jun 15, 2025

Copy link
Copy Markdown
Member

I think we should limit this CFLAGS to bash only. By the way, we use GCC 12(Clang 14.0.5) and the issue does not occur. So it is a requirement for GCC 13 or later?

@jiegec

jiegec commented Jun 15, 2025

Copy link
Copy Markdown
Member

By the way, can you post the full error log, or reproduction environment?

@SolidFaker

Copy link
Copy Markdown
Contributor Author

I think we should limit this CFLAGS to bash only. By the way, we use GCC 12(Clang 14.0.5) and the issue does not occur. So it is a requirement for GCC 13 or later?

yes, im compiling with GCC 15 on archlinux. but im not sure which version of gcc introduced this issue. based on the discussion in the issue linked by my PR, it has been present at least since GCC 13. P.S., the error log is exactly the same as the one in the issue (i found that issue directly through Google search :P

@jiegec

jiegec commented Jun 15, 2025

Copy link
Copy Markdown
Member

I think we should limit this CFLAGS to bash only. By the way, we use GCC 12(Clang 14.0.5) and the issue does not occur. So it is a requirement for GCC 13 or later?

yes, im compiling with GCC 15 on archlinux. but im not sure which version of gcc introduced this issue. based on the discussion in the issue linked by my PR, it has been present at least since GCC 13. P.S., the error log is exactly the same as the one in the issue (i found that issue directly through Google search :P

However, aren't we using cross compilation toolchain (Clang 14.0.5) from HarmonyOS Command Line Tools?

@SolidFaker

Copy link
Copy Markdown
Contributor Author

I think we should limit this CFLAGS to bash only. By the way, we use GCC 12(Clang 14.0.5) and the issue does not occur. So it is a requirement for GCC 13 or later?

yes, im compiling with GCC 15 on archlinux. but im not sure which version of gcc introduced this issue. based on the discussion in the issue linked by my PR, it has been present at least since GCC 13. P.S., the error log is exactly the same as the one in the issue (i found that issue directly through Google search :P

However, aren't we using cross compilation toolchain (Clang 14.0.5) from HarmonyOS Command Line Tools?

indeed, but when i run it here, it ends up using the system's gcc. i'll look into the cause and get back to you.

@jiegec

jiegec commented Jun 15, 2025

Copy link
Copy Markdown
Member

I think I found the reason: mkbuiltin is a part of the build process: it builds and runs on the x86 machine to generate code for cross compilation.

Comment thread build-hnp/utils/Makefrag Outdated
@jiegec jiegec merged commit e40365d into TermonyHQ:master Jun 16, 2025
2 checks passed
mix-il pushed a commit to mix-il/Termony that referenced this pull request Aug 26, 2025
fix: linux cross-build require CFLAGS_FOR_BUILD
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.

2 participants