Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#65700 closed defect (fixed)

thttpd fails to respect Macports arch settings

Reported by: barracuda156 Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: powerpc, rosetta, snowleopard Cc:
Port: thttpd

Description

Build on Rosetta fails with:

--->  Building thttpd
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_thttpd/thttpd/work/thttpd-2.29" && /usr/bin/make -j1 -w all 
make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_thttpd/thttpd/work/thttpd-2.29'
/usr/bin/gcc-4.2 -O2 -DHAVE__PROGNAME=1 -DHAVE_FCNTL_H=1 -DHAVE_GRP_H=1 -DHAVE_MEMORY_H=1 -DHAVE_PATHS_H=1 -DHAVE_POLL_H=1 -DHAVE_SYS_POLL_H=1 -DHAVE_SYS_EVENT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_DIRENT_H=1 -DHAVE_STRERROR=1 -DHAVE_WAITPID=1 -DHAVE_VSNPRINTF=1 -DHAVE_DAEMON=1 -DHAVE_SETSID=1 -DHAVE_SETLOGIN=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_KQUEUE=1 -DHAVE_SIGSET=1 -DHAVE_ATOLL=1 -DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_MMAP=1 -DHAVE_SELECT=1 -DHAVE_POLL=1 -DHAVE_TM_GMTOFF=1 -DHAVE_INT64T=1 -DHAVE_SOCKLENT=1  -I. -c thttpd.c
thttpd.c: In function ‘main’:
thttpd.c:503: warning: ‘daemon’ is deprecated (declared at /usr/include/stdlib.h:289)
rm -f mime_encodings.h
sed < mime_encodings.txt > mime_encodings.h \
	  -e 's/#.*//' -e 's/[ 	]*$//' -e '/^$/d' \
	  -e 's/[ 	][ 	]*/", 0, "/' -e 's/^/{ "/' -e 's/$/", 0 },/'
rm -f mime_types.h
sed < mime_types.txt > mime_types.h \
	  -e 's/#.*//' -e 's/[ 	]*$//' -e '/^$/d' \
	  -e 's/[ 	][ 	]*/", 0, "/' -e 's/^/{ "/' -e 's/$/", 0 },/'
/usr/bin/gcc-4.2 -O2 -DHAVE__PROGNAME=1 -DHAVE_FCNTL_H=1 -DHAVE_GRP_H=1 -DHAVE_MEMORY_H=1 -DHAVE_PATHS_H=1 -DHAVE_POLL_H=1 -DHAVE_SYS_POLL_H=1 -DHAVE_SYS_EVENT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_DIRENT_H=1 -DHAVE_STRERROR=1 -DHAVE_WAITPID=1 -DHAVE_VSNPRINTF=1 -DHAVE_DAEMON=1 -DHAVE_SETSID=1 -DHAVE_SETLOGIN=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_KQUEUE=1 -DHAVE_SIGSET=1 -DHAVE_ATOLL=1 -DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_MMAP=1 -DHAVE_SELECT=1 -DHAVE_POLL=1 -DHAVE_TM_GMTOFF=1 -DHAVE_INT64T=1 -DHAVE_SOCKLENT=1  -I. -c libhttpd.c
/usr/bin/gcc-4.2 -O2 -DHAVE__PROGNAME=1 -DHAVE_FCNTL_H=1 -DHAVE_GRP_H=1 -DHAVE_MEMORY_H=1 -DHAVE_PATHS_H=1 -DHAVE_POLL_H=1 -DHAVE_SYS_POLL_H=1 -DHAVE_SYS_EVENT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_DIRENT_H=1 -DHAVE_STRERROR=1 -DHAVE_WAITPID=1 -DHAVE_VSNPRINTF=1 -DHAVE_DAEMON=1 -DHAVE_SETSID=1 -DHAVE_SETLOGIN=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETNAMEINFO=1 -DH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_SETLOGIN=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_KQUEUE=1 -DHAVE_SIGSET=1 -DHAVE_ATOLL=1 -DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_MMAP=1 -DHAVE_SELECT=1 -DHAVE_POLL=1 -DHAVE_TM_GMTOFF=1 -DHAVE_INT64T=1 -DHAVE_SOCKLENT=1  -I. -c tdate_parse.c
/usr/bin/gcc-4.2 -O2 -DHAVE__PROGNAME=1 -DHAVE_FCNTL_H=1 -DHAVE_GRP_H=1 -DHAVE_MEMORY_H=1 -DHAVE_PATHS_H=1 -DHAVE_POLL_H=1 -DHAVE_SYS_POLL_H=1 -DHAVE_SYS_EVENT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_DIRENT_H=1 -DHAVE_STRERROR=1 -DHAVE_WAITPID=1 -DHAVE_VSNPRINTF=1 -DHAVE_DAEMON=1 -DHAVE_SETSID=1 -DHAVE_SETLOGIN=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_KQUEUE=1 -DHAVE_SIGSET=1 -DHAVE_ATOLL=1 -DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_MMAP=1 -DHAVE_SELECT=1 -DHAVE_POLL=1 -DHAVE_TM_GMTOFF=1 -DHAVE_INT64T=1 -DHAVE_SOCKLENT=1  -I. -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc -o thttpd thttpd.o libhttpd.o fdwatch.o mmc.o timers.o match.o tdate_parse.o   
ld: warning: in thttpd.o, file was built for unsupported file format which is not the architecture being linked (ppc)
ld: warning: in libhttpd.o, file was built for unsupported file format which is not the architecture being linked (ppc)
ld: warning: in fdwatch.o, file was built for unsupported file format which is not the architecture being linked (ppc)
ld: warning: in mmc.o, file was built for unsupported file format which is not the architecture being linked (ppc)
ld: warning: in timers.o, file was built for unsupported file format which is not the architecture being linked (ppc)
ld: warning: in match.o, file was built for unsupported file format which is not the architecture being linked (ppc)
ld: warning: in tdate_parse.o, file was built for unsupported file format which is not the architecture being linked (ppc)
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [thttpd] Error 1

Attachments (1)

thttpd.log (22.2 KB) - added by barracuda156 2 years ago.

Download all attachments as: .zip

Change History (7)

Changed 2 years ago by barracuda156

Attachment: thttpd.log added

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

yes, environment is set up properly, configure seems to use it, but the build does not.

so have to dig in, fix the Makefile, or pass the flags in via confihure args, etc

comment:2 in reply to:  1 Changed 2 years ago by barracuda156

Replying to kencu:

yes, environment is set up properly, configure seems to use it, but the build does not.

so have to dig in, fix the Makefile, or pass the flags in via confihure args, etc

Tried this in portfile:

build.args-append   CC=${configure.cc} \
                    CFLAGS="${configure.cflags} [get_canonical_archflags]"

However, got another failure:

--->  Building thttpd
Executing:  cd "/opt/local/var/macports/build/_opt_PPCRosettaPorts_net_thttpd/thttpd/work/thttpd-2.29" && /usr/bin/make -j1 -w all CC=/usr/bin/gcc-4.2 CFLAGS="-Os -arch ppc" 
make: Entering directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_net_thttpd/thttpd/work/thttpd-2.29'
/usr/bin/gcc-4.2 -Os -arch ppc -c thttpd.c
thttpd.c: In function ‘re_open_logfile’:
thttpd.c:348: error: ‘F_SETFD’ undeclared (first use in this function)
thttpd.c:348: error: (Each undeclared identifier is reported only once
thttpd.c:348: error: for each function it appears in.)
thttpd.c: In function ‘main’:
thttpd.c:443: error: ‘F_SETFD’ undeclared (first use in this function)
make: *** [thttpd.o] Error 1

So this needs more work than just fixing arch linking.

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

that is usually the case :>

Fix the first error, find the next error -- until it's either fixed or you run out of patience ...

comment:4 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Status: newaccepted

comment:5 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 5bfdf862e7475a9860ff41c9c707bbc0745213aa/macports-ports (master):

thttpd: Use our CFLAGS; fix implicit func decls

Closes: #65700

comment:6 in reply to:  5 Changed 2 years ago by barracuda156

Replying to ryandesign:

In 5bfdf862e7475a9860ff41c9c707bbc0745213aa/macports-ports (master):

thttpd: Use our CFLAGS; fix implicit func decls

Closes: #65700

That was quick, thank you!

10:macports-ports svacchanda$ file /opt/local/sbin/thttpd
/opt/local/sbin/thttpd: Mach-O executable ppc
10:macports-ports svacchanda$ port -v installed thttpd
The following ports are currently installed:
  thttpd @2.29_1 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-08-21T15:27:32+0800'
Note: See TracTickets for help on using tickets.