[bug #58172] Precompiled header test broken with GCC >= 9

Yavor Doganov <[email protected]>
Newsgroups gmane.comp.lib.gnustep.bugs
Message-ID <[email protected]>
URL:
  <https://savannah.gnu.org/bugs/?58172>

                 Summary: Precompiled header test broken with GCC >= 9
                 Project: GNUstep
            Submitted by: yavor
            Submitted on: Tue 14 Apr 2020 02:17:13 PM EEST
                Category: Makefiles
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

The script config-precomp-test/run-test.sh puts $LIBS before the program which
makes it fail with GCC 9 or later (where -Wl,--as-needed is implied):


$ LC_ALL=C gcc-8 -lobjc config-precomp-test.m
$ LC_ALL=C gcc-9 -lobjc config-precomp-test.m
/usr/bin/ld: /tmp/cczUhnH0.o: in function `main':
config-precomp-test.m:(.text+0x24): undefined reference to `objc_get_class'
/usr/bin/ld: config-precomp-test.m:(.text+0x36): undefined reference to
`objc_msg_lookup'
/usr/bin/ld: /tmp/cczUhnH0.o: in function `__objc_gnu_init':
config-precomp-test.m:(.text+0x59): undefined reference to
`__objc_exec_class'
collect2: error: ld returned 1 exit status
$ LC_ALL=C gcc-9 config-precomp-test.m -lobjc
$


Patch attached.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 14 Apr 2020 02:17:13 PM EEST  Name:
0001-Amend-precompiled-header-test-so-that-it-works-with-.patch  Size: 3KiB  
By: yavor

<http://savannah.gnu.org/bugs/download.php?file_id=48832>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58172>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.