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

Update Spring to support ARM #51773

Merged
merged 8 commits into from
Oct 30, 2024
Merged
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion recipes/spring/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export CXXPATH=${PREFIX}/include
export CFLAGS="$CFLAGS -I$PREFIX/include"
export CXXFLAGS="$CFLAGS -I$PREFIX/include"
export LDFLAGS="$LDFLAGS -L$PREFIX/lib"
cmake -Dspring_optimize_for_portability=ON ..
if [ $(arch) == aarch64 ]; then
cmake ..
else
cmake -Dspring_optimize_for_portability=ON ..
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix word splitting vulnerability in architecture detection.

The arch command should be quoted to prevent word splitting issues.

Apply this fix:

-if [ $(arch) == aarch64 ]; then
+if [ "$(arch)" = "aarch64" ]; then

Also note the use of = instead of == for better POSIX compatibility.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [ $(arch) == aarch64 ]; then
cmake ..
else
cmake -Dspring_optimize_for_portability=ON ..
fi
if [ "$(arch)" = "aarch64" ]; then
cmake ..
else
cmake -Dspring_optimize_for_portability=ON ..
fi
🧰 Tools
🪛 Shellcheck

[warning] 11-11: Quote this to prevent word splitting.

(SC2046)

make
cp spring $PREFIX/bin


matthdsm marked this conversation as resolved.
Show resolved Hide resolved
Loading