C compiler stopped working

Roland Smith rsmith at xs4all.nl
Tue Aug 23 18:55:06 UTC 2016


On Tue, Aug 23, 2016 at 07:14:10PM +0200, Bernt Hansson wrote:
> Hello list!
> 
> FreeBSD 9.3-RELEASE-p43 #0: Sat May 28 00:19:32 UTC 2016
> root at amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
> 
> 
> About a week or so back i did a pkg delete -af
> and that broke the C compiler in some strange way.

That should not be possible. The compiler is part of the base system.

> If i try pkg add /usr/ports/packages/Latest/pkg.txz the error is missing 
> signature file.
> 
> Moving to /usr/ports/ports-mgmt/pkg and doing a simple make i get this error
> 
> root at kw:/usr/ports/ports-mgmt/pkg # make
> ===>  Configuring for pkg-1.8.7_1
> configure: loading site script /usr/ports/Templates/config.site
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for a thread-safe mkdir -p... (cached) /bin/mkdir -p
> checking for gawk... (cached) /usr/bin/awk
> checking whether make sets $(MAKE)... yes
> checking whether make supports nested variables... yes
> checking whether make supports nested variables... (cached) yes
> checking whether to enable maintainer-specific portions of Makefiles... no
> checking for style of include used by make... GNU
> checking for gcc... cc
> checking whether the C compiler works... no
> configure: error: in `/usr/ports/ports-mgmt/pkg/work/pkg-1.8.7':
> configure: error: C compiler cannot create executables
> See `config.log' for more details
> ===>  Script "configure" failed unexpectedly.
> Please report the problem to pkg at FreeBSD.org [maintainer] and attach the
> "/usr/ports/ports-mgmt/pkg/work/pkg-1.8.7/config.log" including the output
> of the failure of your make command. Also, it might be a good idea to 
> provide
> an overview of all packages installed on your system (e.g. a
> /usr/ports/ports-mgmt/pkg/work/pkg-1.8.7/src/pkg-static info -g -Ea).
> *** [do-configure] Error code 1
> 
> Stop in /usr/ports/ports-mgmt/pkg.
> *** [/usr/ports/ports-mgmt/pkg/work/.configure_done.pkg._usr_local] 
> Error code 1
> 
> Stop in /usr/ports/ports-mgmt/pkg.
> 
> Then i do
> 
> /usr/ports/ports-mgmt/pkg/work/pkg-1.8.7/src/pkg-static info -g -Ea
> 
> /usr/ports/ports-mgmt/pkg/work/pkg-1.8.7/src/pkg-static: Command not found.
> 
> I've uploaded the config.log to
> 
> https://minfil.org/W5tcoab2b5/config.log
> 

From the log file, the linker cannot find libgcc_s:

    configure:3581: checking whether the C compiler works
    configure:3603: cc -O2 -pipe -Wno-error -fstack-protector -fno-strict-aliasing
        -fstack-protector conftest.c  >&5
    /usr/bin/ld: cannot find -lgcc_s
    configure:3607: $? = 1
    configure:3645: result: no

Verify that you still have /lib/libgcc_s.so.1 and /usr/lib/libgcc_s.so (the
latter should be a link to the former):

    > ls -l /lib/libgcc_s.* /usr/lib/libgcc_s*
    -r--r--r--  1 root  wheel  56344 Jun 26 11:37 /lib/libgcc_s.so.1
    lrwxr-xr-x  1 root  wheel     18 Jun 26 11:37 /usr/lib/libgcc_s.so@ -> /lib/libgcc_s.so.1

If the symbolic link is missing, you can easily recreate that.
If the library has gone missing, restore it from a backup.

Roland
-- 
R.F.Smith                                   http://rsmith.home.xs4all.nl/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 5753 3324 1661 B0FE 8D93  FCED 40F6 D5DC A38A 33E0 (keyID: A38A33E0)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20160823/8c45f4f6/attachment.sig>


More information about the freebsd-questions mailing list