cjemorton / skipfish

Automatically exported from code.google.com/p/skipfish
Apache License 2.0
0 stars 0 forks source link

Cant compile on FBSD 6.1 #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Added -I/usr/local/include/, -L/usr/local/lib/ to Makefile, gmake
gmake
cc skipfish.c -o skipfish -Wall -funsigned-char -g -ggdb -
D_FORTIFY_SOURCE=0 -I/usr/local/include/ -O3 -Wno-format http_client.c 
database.c crawler.c analysis.c report.c -lcrypto -lssl -lidn -lz -L/usr/
local/lib/
In file included from skipfish.c:36:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:69: warning: implicit declaration of function 
`malloc_usable_size'
In file included from http_client.c:42:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:69: warning: implicit declaration of function 
`malloc_usable_size'
http_client.c: In function `destroy_unlink_conn':
http_client.c:1618: warning: implicit declaration of function `close'
http_client.c: In function `next_from_queue':
http_client.c:2013: warning: implicit declaration of function `read'
http_client.c:2091: warning: implicit declaration of function `write'
In file included from http_client.h:30,
                 from database.c:33:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:69: warning: implicit declaration of function 
`malloc_usable_size'
In file included from http_client.h:30,
                 from crawler.c:30:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:69: warning: implicit declaration of function 
`malloc_usable_size'
In file included from http_client.h:30,
                 from analysis.c:28:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:69: warning: implicit declaration of function 
`malloc_usable_size'
In file included from http_client.h:30,
                 from report.c:33:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:69: warning: implicit declaration of function 
`malloc_usable_size'
report.c: In function `copy_static_code':
report.c:744: warning: passing arg 3 of `scandir' from incompatible 
pointer type
/var/tmp//ccmILv91.o(.text+0x590): In function `main':
/home/zm/skipfish/skipfish/alloc-inl.h:86: undefined reference to 
`malloc_usable_size'
/var/tmp//ccmILv91.o(.text+0x5c1):/home/zm/skipfish/skipfish/alloc-
inl.h:92: undefined reference to `malloc_usable_size'
/var/tmp//ccmILv91.o(.text+0x67f):/home/zm/skipfish/skipfish/alloc-
inl.h:86: undefined reference to `malloc_usable_size'
/var/tmp//ccmILv91.o(.text+0x6b0):/home/zm/skipfish/skipfish/alloc-
inl.h:92: undefined reference to `malloc_usable_size'
/var/tmp//ccmILv91.o(.text+0x7ac):/home/zm/skipfish/skipfish/alloc-
inl.h:86: undefined reference to `malloc_usable_size'
/var/tmp//ccmILv91.o(.text+0x7dd):/home/zm/skipfish/skipfish/alloc-
inl.h:92: more undefined references to `malloc_usable_size' follow
gmake: *** [skipfish] Error 1

Original issue reported on code.google.com by z3t...@gmail.com on 20 Mar 2010 at 10:50

GoogleCodeExporter commented 8 years ago
can't compile in Ubuntu 9.10

Original comment by 3685...@gmail.com on 20 Mar 2010 at 2:08

GoogleCodeExporter commented 8 years ago
Please edit alloc-inl.h and remove the following two lines (but keep everything 
in 
between):

#ifndef __FreeBSD__
...
#endif /* !__FreeBSD__ */

Please let me know if this helps.

Original comment by lcam...@gmail.com on 20 Mar 2010 at 3:23

GoogleCodeExporter commented 8 years ago
After remove(freebsd 8.0):

# make
cc skipfish.c -o skipfish -Wall -funsigned-char -g -ggdb -D_FORTIFY_SOURCE=0 -O3
-Wno-format http_client.c database.c crawler.c analysis.c report.c -lcrypto 
-lssl
-lidn -lz
In file included from alloc-inl.h:34,
                 from skipfish.c:36:
/usr/include/malloc.h:3:2: error: #error "<malloc.h> has been replaced by 
<stdlib.h>"
In file included from skipfish.c:36:
alloc-inl.h: In function '__DFL_ck_alloc':
alloc-inl.h:67: warning: implicit declaration of function 'malloc_usable_size'
http_client.c:38:18: error: idna.h: No such file or directory
In file included from alloc-inl.h:34,
                 from http_client.c:42:
/usr/include/malloc.h:3:2: error: #error "<malloc.h> has been replaced by 
<stdlib.h>"
In file included from http_client.c:42:
alloc-inl.h: In function '__DFL_ck_alloc':
alloc-inl.h:67: warning: implicit declaration of function 'malloc_usable_size'
http_client.c: In function 'parse_url':
http_client.c:275: warning: implicit declaration of function 'idna_to_ascii_8z'
http_client.c:275: error: 'IDNA_SUCCESS' undeclared (first use in this function)
http_client.c:275: error: (Each undeclared identifier is reported only once
http_client.c:275: error: for each function it appears in.)
http_client.c: In function 'destroy_unlink_conn':
http_client.c:1618: warning: implicit declaration of function 'close'
http_client.c: In function 'next_from_queue':
http_client.c:2013: warning: implicit declaration of function 'read'
http_client.c:2091: warning: implicit declaration of function 'write'
In file included from alloc-inl.h:34,
                 from http_client.h:30,
                 from database.c:33:
/usr/include/malloc.h:3:2: error: #error "<malloc.h> has been replaced by 
<stdlib.h>"
In file included from http_client.h:30,
                 from database.c:33:
alloc-inl.h: In function '__DFL_ck_alloc':
alloc-inl.h:67: warning: implicit declaration of function 'malloc_usable_size'
In file included from alloc-inl.h:34,
                 from http_client.h:30,
                 from crawler.c:30:
/usr/include/malloc.h:3:2: error: #error "<malloc.h> has been replaced by 
<stdlib.h>"
In file included from http_client.h:30,
                 from crawler.c:30:
alloc-inl.h: In function '__DFL_ck_alloc':
alloc-inl.h:67: warning: implicit declaration of function 'malloc_usable_size'
In file included from alloc-inl.h:34,
                 from http_client.h:30,
                 from analysis.c:28:
/usr/include/malloc.h:3:2: error: #error "<malloc.h> has been replaced by 
<stdlib.h>"
In file included from http_client.h:30,
                 from analysis.c:28:
alloc-inl.h: In function '__DFL_ck_alloc':
alloc-inl.h:67: warning: implicit declaration of function 'malloc_usable_size'
In file included from alloc-inl.h:34,
                 from http_client.h:30,
                 from report.c:33:
/usr/include/malloc.h:3:2: error: #error "<malloc.h> has been replaced by 
<stdlib.h>"
In file included from http_client.h:30,
                 from report.c:33:
alloc-inl.h: In function '__DFL_ck_alloc':
alloc-inl.h:67: warning: implicit declaration of function 'malloc_usable_size'
report.c: In function 'copy_static_code':
report.c:744: warning: passing argument 3 of 'scandir' from incompatible 
pointer type
*** Error code 1

Stop in /usr/src/skipfish.
#

Original comment by roman.to...@gmail.com on 20 Mar 2010 at 4:27

GoogleCodeExporter commented 8 years ago
Oh, OK. Next suggestion:

Restore the original file (with the two afoementioned #ifdefs), then find this 
code:

#ifdef __APPLE__
#define malloc_usable_size malloc_size
#endif /* __APPLE__ */

...and eplace it with:

#define malloc_usable_size malloc_size

Original comment by lcam...@google.com on 20 Mar 2010 at 4:47

GoogleCodeExporter commented 8 years ago
gmake
cc skipfish.c -o skipfish -Wall -funsigned-char -g -ggdb -D_FORTIFY_SOURCE=0 
-I/usr/
local/include/ -O3 -Wno-format http_client.c database.c crawler.c analysis.c 
report.c -lcrypto -lssl -lidn -lz -L/usr/local/lib/
In file included from skipfish.c:36:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:67: warning: implicit declaration of function `malloc_size'
In file included from http_client.c:42:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:67: warning: implicit declaration of function `malloc_size'
http_client.c: In function `destroy_unlink_conn':
http_client.c:1618: warning: implicit declaration of function `close'
http_client.c: In function `next_from_queue':
http_client.c:2013: warning: implicit declaration of function `read'
http_client.c:2091: warning: implicit declaration of function `write'
In file included from http_client.h:30,
                 from database.c:33:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:67: warning: implicit declaration of function `malloc_size'
In file included from http_client.h:30,
                 from crawler.c:30:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:67: warning: implicit declaration of function `malloc_size'
In file included from http_client.h:30,
                 from analysis.c:28:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:67: warning: implicit declaration of function `malloc_size'
In file included from http_client.h:30,
                 from report.c:33:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:67: warning: implicit declaration of function `malloc_size'
report.c: In function `copy_static_code':
report.c:744: warning: passing arg 3 of `scandir' from incompatible pointer type
/var/tmp//ccrRIGzu.o(.text+0x590): In function `main':
/home/zm/skipfish/skipfish/alloc-inl.h:84: undefined reference to `malloc_size'
/var/tmp//ccrRIGzu.o(.text+0x5c1):/home/zm/skipfish/skipfish/alloc-inl.h:90: 
undefined reference to `malloc_size'
/var/tmp//ccrRIGzu.o(.text+0x67f):/home/zm/skipfish/skipfish/alloc-inl.h:84: 
undefined reference to `malloc_size'
/var/tmp//ccrRIGzu.o(.text+0x6b0):/home/zm/skipfish/skipfish/alloc-inl.h:90: 
undefined reference to `malloc_size'
/var/tmp//ccrRIGzu.o(.text+0x7ac):/home/zm/skipfish/skipfish/alloc-inl.h:84: 
undefined reference to `malloc_size'
/var/tmp//ccrRIGzu.o(.text+0x7dd):/home/zm/skipfish/skipfish/alloc-inl.h:90: 
more 
undefined references to `malloc_size' follow
gmake: *** [skipfish] Error 1

Original comment by z3t...@gmail.com on 20 Mar 2010 at 5:05

GoogleCodeExporter commented 8 years ago
The last option I can think of is to restore the file to its original shape, 
then put
"#include <malloc_np.h>" after "#include <stdlib.h>" in there.

I investigated a bit, and all signs point to malloc_usable_size() being 
available on
FreeBSD; one manpage suggests using the aforementioned malloc_np.h header, but 
that's
about it...

Original comment by lcam...@google.com on 20 Mar 2010 at 5:51

GoogleCodeExporter commented 8 years ago
no luck
 gmake
cc skipfish.c -o skipfish -Wall -funsigned-char -g -ggdb -D_FORTIFY_SOURCE=0 
-I/usr/
local/include/ -I/usr/src/include/ -O3 -Wno-format http_client.c database.c 
crawler.c analysis.c report.c -lcrypto -lssl -lidn -lz -L/usr/local/lib/
In file included from skipfish.c:24:
/usr/src/include/stdlib.h:90: error: syntax error before "__malloc_like"
/usr/src/include/stdlib.h:97: error: syntax error before "__malloc_like"
In file included from alloc-inl.h:41,
                 from skipfish.c:36:
/usr/src/include/string.h:86: error: syntax error before "__malloc_like"
/usr/src/include/string.h:104: error: syntax error before "__malloc_like"
In file included from skipfish.c:36:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:68: warning: implicit declaration of function `malloc'
In file included from http_client.c:24:
/usr/src/include/stdlib.h:90: error: syntax error before "__malloc_like"
/usr/src/include/stdlib.h:97: error: syntax error before "__malloc_like"
In file included from http_client.c:26:
/usr/src/include/string.h:86: error: syntax error before "__malloc_like"
/usr/src/include/string.h:104: error: syntax error before "__malloc_like"
In file included from http_client.c:42:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:68: warning: implicit declaration of function `malloc'
http_client.c: In function `destroy_unlink_conn':
http_client.c:1618: warning: implicit declaration of function `close'
http_client.c: In function `next_from_queue':
http_client.c:2013: warning: implicit declaration of function `read'
http_client.c:2091: warning: implicit declaration of function `write'
In file included from /usr/include/openssl/crypto.h:62,
                 from /usr/include/openssl/comp.h:5,
                 from /usr/include/openssl/ssl.h:171,
                 from http_client.h:26,
                 from database.c:33:
/usr/src/include/stdlib.h:90: error: syntax error before "__malloc_like"
/usr/src/include/stdlib.h:97: error: syntax error before "__malloc_like"
In file included from alloc-inl.h:41,
                 from http_client.h:30,
                 from database.c:33:
/usr/src/include/string.h:86: error: syntax error before "__malloc_like"
/usr/src/include/string.h:104: error: syntax error before "__malloc_like"
In file included from http_client.h:30,
                 from database.c:33:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:68: warning: implicit declaration of function `malloc'
In file included from /usr/include/openssl/crypto.h:62,
                 from /usr/include/openssl/comp.h:5,
                 from /usr/include/openssl/ssl.h:171,
                 from http_client.h:26,
                 from crawler.c:30:
/usr/src/include/stdlib.h:90: error: syntax error before "__malloc_like"
/usr/src/include/stdlib.h:97: error: syntax error before "__malloc_like"
In file included from alloc-inl.h:41,
                 from http_client.h:30,
                 from crawler.c:30:
/usr/src/include/string.h:86: error: syntax error before "__malloc_like"
/usr/src/include/string.h:104: error: syntax error before "__malloc_like"
In file included from http_client.h:30,
                 from crawler.c:30:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:68: warning: implicit declaration of function `malloc'
In file included from /usr/include/openssl/crypto.h:62,
                 from /usr/include/openssl/comp.h:5,
                 from /usr/include/openssl/ssl.h:171,
                 from http_client.h:26,
                 from analysis.c:28:
/usr/src/include/stdlib.h:90: error: syntax error before "__malloc_like"
/usr/src/include/stdlib.h:97: error: syntax error before "__malloc_like"
In file included from alloc-inl.h:41,
                 from http_client.h:30,
                 from analysis.c:28:
/usr/src/include/string.h:86: error: syntax error before "__malloc_like"
/usr/src/include/string.h:104: error: syntax error before "__malloc_like"
In file included from http_client.h:30,
                 from analysis.c:28:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:68: warning: implicit declaration of function `malloc'
In file included from /usr/include/openssl/crypto.h:62,
                 from /usr/include/openssl/comp.h:5,
                 from /usr/include/openssl/ssl.h:171,
                 from http_client.h:26,
                 from report.c:33:
/usr/src/include/stdlib.h:90: error: syntax error before "__malloc_like"
/usr/src/include/stdlib.h:97: error: syntax error before "__malloc_like"
In file included from alloc-inl.h:41,
                 from http_client.h:30,
                 from report.c:33:
/usr/src/include/string.h:86: error: syntax error before "__malloc_like"
/usr/src/include/string.h:104: error: syntax error before "__malloc_like"
In file included from http_client.h:30,
                 from report.c:33:
alloc-inl.h: In function `__DFL_ck_alloc':
alloc-inl.h:68: warning: implicit declaration of function `malloc'
report.c: In function `copy_static_code':
report.c:744: warning: passing arg 3 of `scandir' from incompatible pointer type
gmake: *** [skipfish] Error 1

Original comment by z3t...@gmail.com on 20 Mar 2010 at 6:09

GoogleCodeExporter commented 8 years ago
Same on 8.0-RELEASE and 6.2-RELEASE

Original comment by z3t...@gmail.com on 20 Mar 2010 at 6:14

GoogleCodeExporter commented 8 years ago
That doesn't make much sense. Will try to get access to fbsd soon.

Original comment by lcam...@google.com on 20 Mar 2010 at 6:17

GoogleCodeExporter commented 8 years ago
I was able to compile on a 7.1 i386 with the advice from comment #6

# make
cc skipfish.c -o skipfish -Wall -funsigned-char -g -ggdb -D_FORTIFY_SOURCE=0 
-O3 -Wno-format 
http_client.c database.c crawler.c analysis.c report.c -lcrypto -lssl -lidn -lz 
-I/usr/local/include/ -
L/usr/local/lib/
http_client.c: In function 'destroy_unlink_conn':
http_client.c:1618: warning: implicit declaration of function 'close'
http_client.c: In function 'next_from_queue':
http_client.c:2013: warning: implicit declaration of function 'read'
http_client.c:2091: warning: implicit declaration of function 'write'
report.c: In function 'copy_static_code':
report.c:744: warning: passing argument 3 of 'scandir' from incompatible 
pointer type

NOTE: See dictionaries/README-FIRST to pick a dictionary for the tool.

Original comment by bad...@gmail.com on 20 Mar 2010 at 8:07

GoogleCodeExporter commented 8 years ago
Comment #6 didn't help me:

...snip...
http_client.c:275: error: for each function it appears in.)
http_client.c: In function 'destroy_unlink_conn':
http_client.c:1618: warning: implicit declaration of function 'close'
http_client.c: In function 'next_from_queue':
http_client.c:2013: warning: implicit declaration of function 'read'
http_client.c:2091: warning: implicit declaration of function 'write'
report.c: In function 'copy_static_code':
report.c:744: warning: passing argument 3 of 'scandir' from incompatible 
pointer type
*** Error code 1

Stop in /usr/local/skipfish.
bsdvm2#

FreeBSD bsdvm2 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan  5 16:02:27 
UTC 2010     
root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386

I installed /usr/ports/misc/compat7x and attempted to recompile per comment 10, 
but 
no luck.

Original comment by ehumphri on 21 Mar 2010 at 5:59

GoogleCodeExporter commented 8 years ago
ehumphri: this seems to be unrelated. You did not paste the actual error, but 
line
275 in http_client.c is a call to one of the libidn functions. I am guessing 
you do
not have libidn properly installed. Please refer to:

http://code.google.com/p/skipfish/wiki/KnownIssues

Original comment by lcam...@google.com on 21 Mar 2010 at 7:02

GoogleCodeExporter commented 8 years ago
After comment #6
# make
cc skipfish.c -o skipfish -Wall -funsigned-char -g -ggdb -D_FORTIFY_SOURCE=0 -O3
-Wno-format http_client.c database.c crawler.c analysis.c report.c -lcrypto 
-lssl
-lidn -lz
http_client.c:38:18: error: idna.h: No such file or directory
http_client.c: In function 'parse_url':
http_client.c:275: warning: implicit declaration of function 'idna_to_ascii_8z'
http_client.c:275: error: 'IDNA_SUCCESS' undeclared (first use in this function)
http_client.c:275: error: (Each undeclared identifier is reported only once
http_client.c:275: error: for each function it appears in.)
http_client.c: In function 'destroy_unlink_conn':
http_client.c:1618: warning: implicit declaration of function 'close'
http_client.c: In function 'next_from_queue':
http_client.c:2013: warning: implicit declaration of function 'read'
http_client.c:2091: warning: implicit declaration of function 'write'
report.c: In function 'copy_static_code':
report.c:744: warning: passing argument 3 of 'scandir' from incompatible 
pointer type
*** Error code 1

Stop in /usr/src/skipfish.

# pkg_info | grep libidn
libidn-1.15         Internationalized Domain Names command line tool
#
(FreeBSD 8.0)

Original comment by roman.to...@gmail.com on 21 Mar 2010 at 11:31

GoogleCodeExporter commented 8 years ago
edit LDFLAGS in Makefile:
LDFLAGS    = -lcrypto -lssl -lidn -lz -L/usr/local/lib

Original comment by z3t...@gmail.com on 21 Mar 2010 at 11:43

GoogleCodeExporter commented 8 years ago
and CFLAGS_GEN:
CFLAGS_GEN = -Wall -funsigned-char -g -ggdb -D_FORTIFY_SOURCE=0 
-I/usr/local/include

Original comment by z3t...@gmail.com on 21 Mar 2010 at 11:44

GoogleCodeExporter commented 8 years ago
Same problem on OpenBSD. No suggested solution helped.

Original comment by openbsdu...@gmail.com on 21 Mar 2010 at 3:57

GoogleCodeExporter commented 8 years ago
This patch fixes all warnings compiling on FreeBSD 8.0-STABLE (amd64 via 
"make"),
assuming ports/dns/libidn was installed.

As malloc_usable_size() first appeared in FreeBSD 7, earlier OS versions will 
have
problems without it.

Original comment by douglas....@gmail.com on 21 Mar 2010 at 4:55

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks. This should be now fixed in 1.07b.

Original comment by lcam...@gmail.com on 21 Mar 2010 at 5:02

GoogleCodeExporter commented 8 years ago
Instructions and patch to compile in OSX: 
http://changux.mycrossoff.com/compiling-google-skipfish-119b-
on-osx

Original comment by chan...@gmail.com on 29 Mar 2010 at 12:27