Opened 11 years ago

Closed 9 years ago

#38822 closed defect (wontfix)

nmap fails to compile, missing "#include <sys/types.h>"

Reported by: aseering@… Owned by: danielluke (Daniel J. Luke)
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: Cc:
Port: nmap

Description

I'm running Mac OS X 10.4.11. When compiling, I get the following error:

:info:build make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_net_nmap/nmap/work
/nmap-6.25/liblua'
(...)
:info:build /usr/bin/gcc-4.0 -O2 -Wall  -no-cpp-precomp -pipe -O2 -arch ppc -Wall -fno-strict-aliasing   -DLUA_USE_MACOSX   -c -o liolib.o liolib.c
:info:build liolib.c: In function <E2><80><98>f_seek<E2><80><99>:
:info:build liolib.c:543: error: <E2><80><98>off_t<E2><80><99> undeclared (first use in this function)
:info:build liolib.c:543: error: (Each undeclared identifier is reported only once
:info:build liolib.c:543: error: for each function it appears in.)
:info:build liolib.c:543: error: parse error before <E2><80><98>offset<E2><80><99>
:info:build liolib.c:544: error: <E2><80><98>offset<E2><80><99> undeclared (first use in this function)
:info:build make[1]: *** [liolib.o] Error 1

(Full main.log is attached.)

If I add

#include <sys/types.h>

to the top of liolib.c, the build succeeds.

I realize that OS X 10.4 is probably not your top priority... But this feels to me like a change for the better; this file does use stuff in sys/types.h, so #include'ing it doesn't strike me as unreasonable. Would you consider patching the port accordingly?

Attachments (1)

main.log (87.1 KB) - added by aseering@… 11 years ago.
main.log from a failed build, illustrating the error

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by aseering@…

Attachment: main.log added

main.log from a failed build, illustrating the error

comment:1 Changed 11 years ago by danielluke (Daniel J. Luke)

I don't have a 10.4 system to test on, but one thing you might want to do is report this upstream.

If you do, please note it here (including whatever fix that ends up being merged upstream). If you can attach a patchfile with your change and a portfile diff (which applies the patch only on 10.4), I'm likely to get to updating the port sooner than if I have to generate it myself (and try to test it somehow).

comment:2 Changed 11 years ago by danielluke (Daniel J. Luke)

Owner: changed from macports-tickets@… to dluke@…
Status: newassigned

comment:3 Changed 11 years ago by mf2k (Frank Schima)

Port: nmap added

In the future, please fill in the Port field and Cc the port maintainer(s).

comment:4 in reply to:  1 Changed 9 years ago by geoffd2

Replying to dluke@…:

I don't have a 10.4 system to test on, but one thing you might want to do is report this upstream.

If you do, please note it here (including whatever fix that ends up being merged upstream). If you can attach a patchfile with your change and a portfile diff (which applies the patch only on 10.4), I'm likely to get to updating the port sooner than if I have to generate it myself (and try to test it somehow).

I just came across this same bug. Type off_t is apparently not native to apple_gcc 4.2, but the code assumes it is. Changing

89  #if defined(LUA_USE_POSIX)      /* { */
    90
    91  #define l_fseek(f,o,w)          fseeko(f,o,w)
    92  #define l_ftell(f)              ftello(f)
    93  #define l_seeknum               off_t

in liolib.c to

89  #if defined(LUA_USE_POSIX)      /* { */
    90
    91  #define l_fseek(f,o,w)          fseeko(f,o,w)
    92  #define l_ftell(f)              ftello(f)
    93  #define l_seeknum               __darwin_off_t

works - that's the definition in /usr/include/sys/types.h - but that's not elegant nor 10.4 specific. I suppose you should check whether 'off_t' is declared at the top of the file (how? does ifndef work for types?) and if not, include sys/types.h . Where is this 'upstream' I should be reporting this to? I doubt I'll be able to write a Portfile, but I'm open to testing.

comment:5 Changed 9 years ago by danielluke (Daniel J. Luke)

Resolution: wontfix
Status: assignedclosed

Upstream == the nmap developers.

I'm going to close this as wontfix for now (since 10.4 is /old/ and no one should be running it) - but I'm willing to include a build fix if you can get it fixed upstream.

Note: See TracTickets for help on using tickets.