• Warning: requires executable stack...

    From reinert@21:1/5 to All on Thu Apr 27 22:38:22 2023
    Hello,

    I use alire and I just updated via these commands:

    alr index --update-all
    alr toolchain --select

    (selected
    gnat_native=12.2.1
    and
    gprbuild=22.0.1
    )

    All seem OK, but when I use "alr build" I finally get this warning:

    ...../.config/alire/cache/dependencies/gnat_native_12.2.1_11f3b811/bin/../lib/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: kobio0.o: requires executable stack (because the .note.GNU-stack section is executable)
    Build finished successfully in 19.48 seconds.

    When trying a simple "hello_world" programme, I do not get this annoying warning.

    Any hint?
    I do not like warnings which I do not understand anything from :-)

    reinert

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Wright@21:1/5 to reinert on Fri Apr 28 08:26:17 2023
    reinert <reinkor@gmail.com> writes:

    ...../.config/alire/cache/dependencies/gnat_native_12.2.1_11f3b811/bin/../lib/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
    warning: kobio0.o: requires executable stack (because the
    .note.GNU-stack section is executable)

    Creating executable code on the stack is one way of getting malicious
    code past virus checkers. Modern OSs will prevent this approach.

    So far as I know, GNAT will only do this to implement "trampolines", but see here: https://docs.adacore.com/live/wave/gnat_rm/html/gnat_rm/gnat_rm/standard_and_implementation_defined_restrictions.html#no-implicit-dynamic-code

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From reinert@21:1/5 to All on Fri Apr 28 03:04:56 2023
    Thanks for swift answer. Seems like I have to live with the warning.

    I learned about pragma restrictions(...); :-)

    reinert


    fredag 28. april 2023 kl. 09:26:20 UTC+2 skrev Simon Wright:
    reinert <rei...@gmail.com> writes:

    ...../.config/alire/cache/dependencies/gnat_native_12.2.1_11f3b811/bin/../lib/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
    warning: kobio0.o: requires executable stack (because the
    .note.GNU-stack section is executable)
    Creating executable code on the stack is one way of getting malicious
    code past virus checkers. Modern OSs will prevent this approach.

    So far as I know, GNAT will only do this to implement "trampolines", but see here: https://docs.adacore.com/live/wave/gnat_rm/html/gnat_rm/gnat_rm/standard_and_implementation_defined_restrictions.html#no-implicit-dynamic-code

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)