Brian,

On 10/28/20 21:24, Paquin, Brian wrote:
Chris,

On Oct 27, 2020, at 12:31 PM, Christopher Schultz 
<ch...@christopherschultz.net> wrote:

Brian

On 10/26/20 15:33, Paquin, Brian wrote:
I’m trying to build httpd and mod_jk for the first time on a macOS 10.15.7 box. 
XCode 12.1 is installed and I was able to compile OpenSSL 1.1.1g.
I got an error “Can not determine the proper size for pid_t” when compiling 
httpd (v2.4.46) with included apr (v1.7.0).
This issue 
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbz.apache.org%2Fbugzilla%2Fshow_bug.cgi%3Fid%3D64753&amp;data=04%7C01%7Cbrian.paquin%40yale.edu%7C4a009b9f4c19439afc4708d87a95d92e%7Cdd8cbebb21394df8b4114e3e87abeb5c%7C0%7C0%7C637394131299938700%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=WdzfXIIBvFQzON0aA2Q3EHqNyHK2bFqXpGYm2aEyi1A%3D&amp;reserved=0
 provided a diff patch that adds “#include <stdlib.h>” in a number of locations.
Applying this patch allowed me to compile httpd!

Weird. pid_it is defined in <sys/types.h> and yet the patch adds <stdlib.h> to 
fix it.

I don't have access to my Catalina machine right now, but my clang-based Mojave machine still 
says to use <sys/types.h> when you "man getpid":

"
GETPID(2)                   BSD System Calls Manual

NAME
     getpid, getppid -- get parent or calling process identification

SYNOPSIS
     #include <unistd.h>

     pid_t
     getpid(void);
"

$ cc --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Now I am trying to compile mod_jk (v1.2.48), and I get the same error.
Does someone have a patch file I can use to get around this issue?
$ ./configure CFLAGS='-arch x86_64' APXSLDFLAGS='-arch x86_64' 
--with-apxs=/usr/local/apache2/bin/apxs
<snip>
$ make
<snip>
Making all in common
/usr/local/apache-2.4.46/build/libtool --silent --mode=compile gcc -I. 
-I/usr/local/apache-2.4.46/include -arch x86_64 -DHAVE_CONFIG_H -arch x86_64  
-DHAVE_APR  -I/usr/local/apache-2.4.46/include 
-I/usr/local/apache-2.4.46/include -arch x86_64 -DHAVE_CONFIG_H -DDARWIN 
-DSIGPROCMASK_SETS_THREAD_MASK -DDARWIN_10 -c jk_ajp12_worker.c -o 
jk_ajp12_worker.lo
In file included from jk_ajp12_worker.c:25:
In file included from ./jk_ajp12_worker.h:26:
In file included from ./jk_logger.h:26:
In file included from ./jk_global.h:340:
./jk_types.h:56:2: error: Can not determine the proper size for pid_t
#error Can not determine the proper size for pid_t
  ^
./jk_types.h:62:2: error: Can not determine the proper size for pthread_t
#error Can not determine the proper size for pthread_t
  ^
2 errors generated.
make[1]: *** [jk_ajp12_worker.lo] Error 1
make: *** [all-recursive] Error 1
$

I'm sorry, I have no idea how configure does its magic. The auto-generated 
jk_types.h looks like a hand-wavy template to me.

You can probably hack it briefly by running "configure" (which you already did) 
and then hand-editing include/jk_types.h (ignoring the warning NOT to hand-edit it!) and 
manually adding:

#include <stdlib.h>

to the top.

I added the line above to 
./tomcat-connectors-1.2.48-src/native/common/jk_types.h and tried running make 
again but got the same error. I do not have an include directory in 
./tomcat-connectors-1.2.48-src/native/.

Any other suggestions?

Sorry, native/common/jk_types.h was the file I meant.

Can you just post the whole content of that file? I'm guessing that you have something like:

typedef jk_pid_t @pid_t@ ;

leftover from 'configure' not finding the right definition. We may have to adjust that line, too.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to