You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "haiyuewa (via GitHub)" <gi...@apache.org> on 2024/10/25 03:51:57 UTC
[PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
haiyuewa opened a new pull request, #14505:
URL: https://github.com/apache/nuttx/pull/14505
Fix the linker warning based on these two commits:
ld: warning: fork.o: missing .note.GNU-stack section implies executable stack
ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
commit 36ac81211454 ("sim: Fixes the following linker warning:"),
commit b5d640acc5b3 ("fix Cygwin/MSYS2 ld: unrecognized option '-z'")
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "haiyuewa (via GitHub)" <gi...@apache.org>.
haiyuewa commented on code in PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#discussion_r1816041816
##########
arch/x86_64/src/common/Toolchain.defs:
##########
@@ -106,6 +106,12 @@ ifeq ($(CONFIG_DEBUG_LINK_WHOLE_ARCHIVE),y)
LDFLAGS += --whole-archive
endif
+ifeq ($(CONFIG_HOST_LINUX),y)
Review Comment:
> can you update cmake too
Done in new commit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "haiyuewa (via GitHub)" <gi...@apache.org>.
haiyuewa commented on code in PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#discussion_r1816013801
##########
arch/x86_64/src/common/Toolchain.defs:
##########
@@ -106,6 +106,12 @@ ifeq ($(CONFIG_DEBUG_LINK_WHOLE_ARCHIVE),y)
LDFLAGS += --whole-archive
endif
+ifeq ($(CONFIG_HOST_LINUX),y)
Review Comment:
> do you need change Makefile under arch/sim instead arch/x86_64?
I didn't see warning, when run "./tools/configure.sh -l sim:ostest".
The build design is arch/x86_64 is based on arch/sim ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#discussion_r1815966235
##########
arch/x86_64/src/common/Toolchain.defs:
##########
@@ -106,6 +106,12 @@ ifeq ($(CONFIG_DEBUG_LINK_WHOLE_ARCHIVE),y)
LDFLAGS += --whole-archive
endif
+ifeq ($(CONFIG_HOST_LINUX),y)
Review Comment:
can you update cmake too
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "haiyuewa (via GitHub)" <gi...@apache.org>.
haiyuewa commented on PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#issuecomment-2437099989
> > gcc --version
> > gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
>
> interesting, for me the problem doesn't occur for both `gcc 14.1.1` and `gcc 13.3.0`. Probably some linux distro differences in `binutils`
My version is:
ld --version
GNU ld (GNU Binutils for Ubuntu) 2.42
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#issuecomment-2437095905
> gcc --version
gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
interesting, for me the problem doesn't occur for both `gcc 14.1.1` and `gcc 13.3.0`. Probably some linux distro differences in `binutils`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "haiyuewa (via GitHub)" <gi...@apache.org>.
haiyuewa commented on code in PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#discussion_r1816079429
##########
arch/x86_64/src/common/Toolchain.defs:
##########
@@ -106,6 +106,12 @@ ifeq ($(CONFIG_DEBUG_LINK_WHOLE_ARCHIVE),y)
LDFLAGS += --whole-archive
endif
+ifeq ($(CONFIG_HOST_LINUX),y)
Review Comment:
> if so, CONFIG_HOST_LINUX should drop since CONFIG_HOST_xxx is only meaningful for sim arch.
I changed it as the build bug fix : b5d640acc5b3 ("fix Cygwin/MSYS2 ld: unrecognized option '-z'")
Is it about build system ? Since adding it will also make the patch work.
-l selects the Linux (l) host environment.
-m selects the macOS (m) host environment.
-c selects the Windows host and Cygwin (c) environment.
-g selects the Windows host and MinGW/MSYS environment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#issuecomment-2437065479
@haiyuewa hi, how to reproduce this warning ? is this something toolchain specific? I've never seen anything like this and I'm curious why :)
BTW x86_64 port isn't based on sim port, so changes from one don't always fir the other
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#issuecomment-2437141659
> ld --version
GNU ld (GNU Binutils for Ubuntu) 2.42
the same on my side. But it's possible that arch linux applies some additional patches to binutils/gcc or the reason is something else
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#discussion_r1816065944
##########
arch/x86_64/src/cmake/Toolchain.cmake:
##########
@@ -83,6 +83,12 @@ if(CONFIG_DEBUG_SYMBOLS)
add_compile_options(${CONFIG_DEBUG_SYMBOLS_LEVEL})
endif()
+if(CONFIG_HOST_LINUX)
+ if(CONFIG_ARCH_HAVE_FORK)
Review Comment:
why need check CONFIG_ARCH_HAVE_FORK
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "haiyuewa (via GitHub)" <gi...@apache.org>.
haiyuewa commented on code in PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#discussion_r1816994117
##########
arch/x86_64/src/cmake/Toolchain.cmake:
##########
@@ -83,6 +83,12 @@ if(CONFIG_DEBUG_SYMBOLS)
add_compile_options(${CONFIG_DEBUG_SYMBOLS_LEVEL})
endif()
+if(CONFIG_HOST_LINUX)
+ if(CONFIG_ARCH_HAVE_FORK)
Review Comment:
> why need check CONFIG_ARCH_HAVE_FORK
This warning is just caused by fork.o, so added this macro check. Make sense to remove this, not only for this object link.
Will remove it. Align this to the comment from @raiden00pl
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#discussion_r1816065615
##########
arch/x86_64/src/common/Toolchain.defs:
##########
@@ -106,6 +106,12 @@ ifeq ($(CONFIG_DEBUG_LINK_WHOLE_ARCHIVE),y)
LDFLAGS += --whole-archive
endif
+ifeq ($(CONFIG_HOST_LINUX),y)
Review Comment:
if so, CONFIG_HOST_LINUX should drop since CONFIG_HOST_xxx is only meaningful for sim arch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "haiyuewa (via GitHub)" <gi...@apache.org>.
haiyuewa commented on PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#issuecomment-2437073488
> @haiyuewa hi, how to reproduce this warning ? is this something toolchain specific? I've never seen anything like this and I'm curious why :) BTW x86_64 port isn't based on sim port, so changes from one don't always fir the other
gcc --version
gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
ubuntu 24.04.1
Then:
./tools/configure.sh -l qemu-intel64:ostest
time make -j $(nproc --all)
OR
cmake -B build -DBOARD_CONFIG=qemu-intel64:ostest -GNinja
cmake --build build
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on code in PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#discussion_r1816128544
##########
arch/x86_64/src/cmake/Toolchain.cmake:
##########
@@ -83,6 +83,12 @@ if(CONFIG_DEBUG_SYMBOLS)
add_compile_options(${CONFIG_DEBUG_SYMBOLS_LEVEL})
endif()
+if(CONFIG_HOST_LINUX)
+ if(CONFIG_ARCH_HAVE_FORK)
Review Comment:
` if(CONFIG_ARCH_HAVE_FORK)` doesn't make sense in x86_64 port context, it is always set to `y`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "haiyuewa (via GitHub)" <gi...@apache.org>.
haiyuewa commented on code in PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#discussion_r1816135134
##########
arch/x86_64/src/cmake/Toolchain.cmake:
##########
@@ -83,6 +83,12 @@ if(CONFIG_DEBUG_SYMBOLS)
add_compile_options(${CONFIG_DEBUG_SYMBOLS_LEVEL})
endif()
+if(CONFIG_HOST_LINUX)
+ if(CONFIG_ARCH_HAVE_FORK)
Review Comment:
Since the warning is caused by linking fork.o:
So I added the macro as source file did:
vi arch/x86_64/src/common/Make.defs +28
ifeq ($(CONFIG_ARCH_HAVE_FORK),y)
CMN_CSRCS += x86_64_fork.c
CMN_ASRCS += fork.S
endif
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#discussion_r1816008024
##########
arch/x86_64/src/common/Toolchain.defs:
##########
@@ -106,6 +106,12 @@ ifeq ($(CONFIG_DEBUG_LINK_WHOLE_ARCHIVE),y)
LDFLAGS += --whole-archive
endif
+ifeq ($(CONFIG_HOST_LINUX),y)
Review Comment:
do you need change Makefile under arch/sim instead arch/x86_64?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on code in PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#discussion_r1816139037
##########
arch/x86_64/src/cmake/Toolchain.cmake:
##########
@@ -83,6 +83,12 @@ if(CONFIG_DEBUG_SYMBOLS)
add_compile_options(${CONFIG_DEBUG_SYMBOLS_LEVEL})
endif()
+if(CONFIG_HOST_LINUX)
+ if(CONFIG_ARCH_HAVE_FORK)
Review Comment:
condition in `arch/x86_64/src/common/Make.defs` also doesn't make sense, this option is set permanently here:
https://github.com/apache/nuttx/blob/b28f87e3f0cd4ec901b2a716fea15378cb4cfd09/arch/Kconfig#L147
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #14505:
URL: https://github.com/apache/nuttx/pull/14505
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] qemu-intel64: Fixes the linker 'noexecstack' warning [nuttx]
Posted by "nuttxpr (via GitHub)" <gi...@apache.org>.
nuttxpr commented on PR #14505:
URL: https://github.com/apache/nuttx/pull/14505#issuecomment-2436921470
[**\[Experimental Bot, please feedback here\]**](https://github.com/search?q=repo%3Aapache%2Fnuttx+13552&type=issues)
Let's break down this Pull Request (PR) against the NuttX requirements.
**Summary:**
* **Why?** Addresses linker warnings related to missing ".note.GNU-stack" sections, improving build clarity.
* **What?** Modifies how the stack is marked (likely adding the missing section) during compilation.
* **How?** Unclear without seeing the code changes. The PR description references two related commits, suggesting this might be a backport or adaptation of those fixes.
* **Related Issues:** The PR description should ideally link directly to any relevant NuttX issues.
**Impact:**
* **New Feature? Existing Feature Changed?** Likely an existing feature (compilation/linking) being fixed.
* **User Impact?** Probably NO. This seems like an internal improvement.
* **Build Impact?** Potentially YES. The linker behavior is changing, which might impact build scripts or configurations.
* **Hardware Impact?** Likely NO, unless the fix involves architecture-specific stack handling.
* **Documentation Impact?** Possibly YES if the linker changes necessitate build instruction updates.
* **Security Impact?** Unclear without code review. Stack manipulation can have security implications.
* **Compatibility Impact?** Unclear without code review. Changes to low-level constructs like stack handling can affect compatibility.
**Testing:**
* **Insufficient Information.** The PR description provides a template but lacks specific details about the testing environment (host OS, compiler versions, target architectures/boards). The testing logs are also placeholders.
**Verdict:**
This PR **partially meets** the NuttX requirements.
**To Improve:**
* **Expand the "How" section:** Briefly explain the code changes.
* **Link related issues:** Provide direct links if applicable.
* **Complete the "Impact" assessment:** Address the "unclear" points with specifics.
* **Provide detailed testing information:**
* List the build hosts and target environments used for verification.
* Include actual testing logs from before and after the change.
By providing this additional context, the PR will be much stronger and easier for maintainers to review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org