Bug 229348 - [exp-run] Remove GPL'd libssp from libc
Summary: [exp-run] Remove GPL'd libssp from libc
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL: https://reviews.freebsd.org/D15687
Keywords: patch
Depends on:
Blocks: 228919
  Show dependency treegraph
 
Reported: 2018-06-26 16:05 UTC by Pedro F. Giffuni
Modified: 2019-08-23 21:08 UTC (History)
3 users (show)

See Also:


Attachments
Patch to define libssp as part of gcclibs (436 bytes, patch)
2018-06-26 16:05 UTC, Pedro F. Giffuni
no flags Details | Diff
Define libssp as part of gcclibs and don't include libssp in libc (1.54 KB, patch)
2018-07-15 22:08 UTC, Pedro F. Giffuni
no flags Details | Diff
Fix by adjusting libc.ldscript to not link libssp (3.22 KB, patch)
2019-08-03 21:58 UTC, Pedro F. Giffuni
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro F. Giffuni freebsd_committer 2018-06-26 16:05:54 UTC
Created attachment 194651 [details]
Patch to define libssp as part of gcclibs

GCC includes libssp which we have historically linked into our libc(!),

It appears this library is not really needed as it is meant to support FORTIFY_SOURCE but we never brought any way to link the wrapper functions.

As discussed in https://reviews.freebsd.org/D15687, we should get away by building along with the other gcclibs only when GCC is built.

Buildworld passes on current, but If you can please try a clean build with this patch we should confirm if some port is trying to link anything from there.
Comment 1 Antoine Brodin freebsd_committer 2018-06-30 17:38:52 UTC
We can't build any port with the provided patch.


checking whether the C compiler works... no
configure: error: in `/wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.10.5':
configure: error: C compiler cannot create executables
Comment 2 Antoine Brodin freebsd_committer 2018-06-30 17:41:04 UTC
From config.log:

configure:3586: checking whether the C compiler works
configure:3608: cc -O2 -pipe  -Wno-error -fstack-protector -fno-strict-aliasing   -fstack-protector conftest.c  >&5
/usr/bin/ld: error: cannot open /usr/lib/libssp_nonshared.a: No such file or directory
cc: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 3 Pedro F. Giffuni freebsd_committer 2018-07-03 21:55:07 UTC
Thanks it was good to know what is failing but I abandoned the revision, at least for now.
Comment 4 Pedro F. Giffuni freebsd_committer 2018-07-15 22:08:42 UTC
Created attachment 195162 [details]
Define libssp as part of gcclibs and don't include libssp in libc

Looking at this further, libssp_nonshared shouldn't be in libc at all.
Comment 5 Pedro F. Giffuni freebsd_committer 2018-07-15 22:09:36 UTC
Re-open: can you kindly test this new patch?
Comment 6 Pedro F. Giffuni freebsd_committer 2018-07-15 22:56:36 UTC
(In reply to Pedro F. Giffuni from comment #5)
Nevermind .. I am having build issues.
Comment 7 Pedro F. Giffuni freebsd_committer 2019-08-03 21:58:45 UTC
Created attachment 206258 [details]
Fix by adjusting libc.ldscript to not link libssp

libc was bogusly linking libgcc_noshared when we were expecting simply to drop it.

The issue seems to be in libc.ldscript.

This patch works for all platforms except powerpc but jhibbits has confirmed the issue will go away once powerpc is moved to clang.

An exp-run should work OK now.
Comment 8 Pedro F. Giffuni freebsd_committer 2019-08-03 22:00:52 UTC
New patch: should work on all platforms, except powerpc temporarily.
Comment 9 Antoine Brodin freebsd_committer 2019-08-08 10:57:33 UTC
Exp-run is still not good,  for instance

checking whether the C compiler works... no
configure: error: in `/wrkdirs/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.7.3':
configure: error: C compiler cannot create executables
Comment 10 Pedro F. Giffuni freebsd_committer 2019-08-08 16:26:54 UTC
(In reply to Antoine Brodin from comment #9)
Thanks (back to drawing board)