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

[clang][Driver] Fix safestack -u ordering #98468

Merged
merged 1 commit into from
Jul 11, 2024

Commits on Jul 11, 2024

  1. [clang][Driver] Fix safestack -u ordering

    When re-enabling safestack testing on Solaris after the unexplained
    b0260c5, all tests `FAIL`ed to link:
    
    ```
    Undefined			first referenced
     symbol  			    in file
    __safestack_unsafe_stack_ptr        buffer-copy-vla.o
    __safestack_init                    (command line)
    ld: fatal: symbol referencing errors
    ```
    
    The problem is that `-u __safestack_init` was passed to the linker after
    the corresponding version of `libclang_rt.safestack-*.a`.  Since the
    Solaris linker (like Unix linkers for decades) respects the command line
    argument order (unlike e.g. GNU ld which uses GNU getopt), this cannot
    work.  Fixed by moving the `-u` arg further to the front.  Two affected
    testcases were fixed accordingly.
    
    Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`,
    `x86_64-pc-linux-gnu`, and `sparc64-unknown-linux-gnu`.
    rorth committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    88dfd3a View commit details
    Browse the repository at this point in the history