public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/28738] New: LIBC_LINKER_FEATURE doesn't work on linker -z option
@ 2022-01-02 14:00 hjl.tools at gmail dot com
  2022-01-03 13:12 ` [Bug build/28738] " cvs-commit at gcc dot gnu.org
  2022-01-12 14:25 ` hjl.tools at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2022-01-02 14:00 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28738

            Bug ID: 28738
           Summary: LIBC_LINKER_FEATURE doesn't work on linker -z option
           Product: glibc
           Version: 2.35
            Status: NEW
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
                CC: carlos at redhat dot com
  Target Milestone: ---

[hjl@gnu-tgl-2 tmp]$ touch x.c
[hjl@gnu-tgl-2 tmp]$ gcc -shared -Wl,-z,foobar x.c
/usr/local/bin/ld: warning: -z foobar ignored
[hjl@gnu-tgl-2 tmp]$ echo $?
0
[hjl@gnu-tgl-2 tmp]$ 

But LIBC_LINKER_FEATURE has

dnl Check linker option support.
dnl LIBC_LINKER_FEATURE([ld_option], [cc_option], [action-if-true],
[action-if-false])
AC_DEFUN([LIBC_LINKER_FEATURE],
[AC_MSG_CHECKING([for linker that supports $1])
libc_linker_feature=no
if test x"$gnu_ld" = x"yes"; then
  cat > conftest.c <<EOF
int _start (void) { return 42; }
EOF
  if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
                    $2 -nostdlib -nostartfiles
                    -fPIC -shared -o conftest.so conftest.c
                    1>&AS_MESSAGE_LOG_FD])
  then
    libc_linker_feature=yes
  fi
  rm -f conftest*
fi

Check for any linker -z option will be successful.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug build/28738] LIBC_LINKER_FEATURE doesn't work on linker -z option
  2022-01-02 14:00 [Bug build/28738] New: LIBC_LINKER_FEATURE doesn't work on linker -z option hjl.tools at gmail dot com
@ 2022-01-03 13:12 ` cvs-commit at gcc dot gnu.org
  2022-01-12 14:25 ` hjl.tools at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-03 13:12 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28738

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bd1616c6bee625a2726d0f8b477881b4b25697d8

commit bd1616c6bee625a2726d0f8b477881b4b25697d8
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jan 2 06:01:21 2022 -0800

    Properly check linker option in LIBC_LINKER_FEATURE [BZ #28738]

    Update LIBC_LINKER_FEATURE to also check linker warning message since
    unknown linker -z option may be ignored by linker:

    $ touch x.c
    $ gcc -shared -Wl,-z,foobar x.c
    /usr/bin/ld: warning: -z foobar ignored
    $ echo $?
    0
    $

    This fixes BZ #28738.

    Reviewed-by: Florian Weimer <fweimer@redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug build/28738] LIBC_LINKER_FEATURE doesn't work on linker -z option
  2022-01-02 14:00 [Bug build/28738] New: LIBC_LINKER_FEATURE doesn't work on linker -z option hjl.tools at gmail dot com
  2022-01-03 13:12 ` [Bug build/28738] " cvs-commit at gcc dot gnu.org
@ 2022-01-12 14:25 ` hjl.tools at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2022-01-12 14:25 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28738

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.35
             Status|NEW                         |RESOLVED

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed for 2.35.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-12 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-02 14:00 [Bug build/28738] New: LIBC_LINKER_FEATURE doesn't work on linker -z option hjl.tools at gmail dot com
2022-01-03 13:12 ` [Bug build/28738] " cvs-commit at gcc dot gnu.org
2022-01-12 14:25 ` hjl.tools at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).