[Bug 3806] New: "make tests" fails if LDFLAGS has multiple occurrences of -pie

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Thu Apr 3 04:11:28 AEDT 2025


https://bugzilla.mindrot.org/show_bug.cgi?id=3806

            Bug ID: 3806
           Summary: "make tests" fails if LDFLAGS has multiple occurrences
                    of -pie
           Product: Portable OpenSSH
           Version: 9.9p2
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Regression tests
          Assignee: unassigned-bugs at mindrot.org
          Reporter: alarrosa at suse.com

Created attachment 3867
  --> https://bugzilla.mindrot.org/attachment.cgi?id=3867&action=edit
Remove all occurrences of -pie

Running `make tests` on openSUSE Tumbleweed failed because the
LDFLAGS_NOPIE variable in Makefile _did_ include a -pie flag:

LDFLAGS=-L. -Lopenbsd-compat/ -pie -Wl,--as-needed -Wl,-z,relro
-Wl,-z,now -Wl,-z,noexecstack -fstack-protector-strong -pie
LDFLAGS_NOPIE=-L. -Lopenbsd-compat/ -pie -Wl,--as-needed -Wl,-z,relro
-Wl,-z,now -Wl,-z,noexecstack -fstack-protector-strong

This resulted in a failure to build sk-dummy.so since gcc was expecting
a main function.

The problem comes from LDFLAGS having -pie twice but the sed expression
that removes the flag only removes the one match. Also, LDFLAGS starts
with "-pie ..." so that one isn't even caught by the "s/ -pie//" regex.

I've attached a patch that I tested that fixes this issue.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list