Opened 3 years ago

Closed 3 years ago

Last modified 8 months ago

#63457 closed defect (fixed)

sitecopy error: implicit declaration of function 'socket' is invalid in C99

Reported by: scrutarius Owned by: julian@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: glennra (Glenn Ramsey)
Port: sitecopy

Description

Sitecopy is not compiling on the latest Big Sur (11.5.2) on my M1-based iMac. I am guessing it is a neon compatibility, but that is a guess on my part. The log shows the following:

:info:configure checking for strcasecmp... yes
:info:configure checking for signal... yes
:info:configure checking for setvbuf... yes
:info:configure checking for setsockopt... yes
:info:configure checking for stpcpy... yes
:info:configure checking for poll... (cached) no
:info:configure checking for fcntl... yes
:info:configure checking for getsockopt... yes
:info:configure checking whether stpcpy is declared... yes
:info:configure checking for library containing socket... not found
:info:configure configure: error: could not find library containing socket

The later line being the probable cause.

I would add that it does not compile on my intel-based iMac running Catalina 10.15.7 either. I've copied over the binary from another intel-based iMac running Catalina 10.15.7 to this intel-based machine (not the M1!) where it was been working as a temporary fix.

Change History (13)

comment:1 Changed 3 years ago by kencu (Ken)

for this kind of build there should be a file called "config.log" that has the actual attempted build commands and output from the tools in it. If you look in there at the part where the socket library testing is happening, you may find the clue you need to solve your issue.

If I tried to fix it, that is exactly where I would start.

comment:2 Changed 3 years ago by kencu (Ken)

Owner: set to julian@…
Port: sitecopy added
Status: newassigned

comment:3 Changed 3 years ago by scrutarius

| int
| main ()
| {
| socket();
|   ;
|   return 0;
| }
configure:11511: gcc -o conftest -g -O2  -no-cpp-precomp  -flat_namespace conftest.c  -linet  >&5
conftest.c:73:1: error: implicit declaration of function 'socket' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
socket();
^
1 error generated.


As I said, socket is missing. No idea why.

comment:4 Changed 3 years ago by kencu (Ken)

Ah, that turns out to be an easier one.

The newer systems fail on implicit function definitions.

The trick is to find the header that defines the function, and properly add it to the test.

We have fixed this in other ports about 1.2 million times so far :>

comment:5 Changed 3 years ago by kencu (Ken)

Summary: SItecopy not compiling under Big Sur on M1-based iMacsItecopy error: implicit declaration of function 'socket' is invalid in C99

comment:6 Changed 3 years ago by kencu (Ken)

Given this port is apparently running configure with "gcc" it looks like it hasn't had any proper attention in some time...

comment:7 Changed 3 years ago by kencu (Ken)

Summary: sItecopy error: implicit declaration of function 'socket' is invalid in C99sitecopy error: implicit declaration of function 'socket' is invalid in C99

comment:8 Changed 3 years ago by kencu (Ken)

Yike. Last update was 2008

http://www.manyfish.co.uk/sitecopy/

not sure if this one is still worth having in MacPorts any longer -- but I will take a peek if it's easy.

Are you sure there is not something more recent that would work for you?

comment:9 Changed 3 years ago by kencu (Ken)

here you go

https://github.com/macports/macports-ports/pull/12121

 % port -v installed sitecopy
The following ports are currently installed:
  sitecopy @0.16.6_1 (active) requested_variants='' platform='darwin 20' archs='x86_64' date='2021-09-06T15:49:28-0700'

comment:10 Changed 3 years ago by scrutarius

Thanks!

comment:11 Changed 3 years ago by Ken <21211439+kencu@…>

Resolution: fixed
Status: assignedclosed

In 0b2e83d69e3a22c006dff4775d74bab7c091ad1a/macports-ports (master):

sitecopy: allow newer neon versions (https://github.com/macports/macports-ports/pull/12121)

allows our current neon 31 to satisfy the check
closes: #63457

comment:12 Changed 19 months ago by glennra (Glenn Ramsey)

This is broken again, now that neon is at version 32.

comment:13 in reply to:  12 Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: glennra added

Replying to glennra:

This is broken again, now that neon is at version 32.

That's now filed as #68122.

Note: See TracTickets for help on using tickets.