glibc-2.3.2 에서 sunrpc를 분리 컴파일 하려고 하는데...

brian.ryu의 이미지

glibc-2.3.2에서 sunrpc부분을 분리 컴파일 하려고 합니다.

헌데, Makefile을 보면 include ../makeconfig 와 include .../Rules 가 연결되어 있더군요...

Q1)
glibc-2.3.2/makeconfig 와 Rules 가 어떤 역할을 하는 파일 들인지 알고 싶습니다.

Q2)
sunrpc 파일들 중에서 한개만 우선 컴파일 해보려고 합니다.
근데, 잘 안되는군요...

[root@atlas sunrpc]# gcc -c clnt_gen.c
clnt_gen.c: In function `clnt_create':
clnt_gen.c:89: warning: assignment makes pointer from integer without a cast
clnt_gen.c:102: warning: assignment makes pointer from integer without a cast
clnt_gen.c:121: warning: assignment makes pointer from integer without a cast
clnt_gen.c:135: warning: assignment makes pointer from integer without a cast
clnt_gen.c:144: called object is not a function
clnt_gen.c:158: called object is not a function
clnt_gen.c: At top level:
clnt_gen.c:183: parse error at end of input

위에서 At top level 이 무슨말인지 모르겠습니다.

Q3) 다음은 clnt_gen.c 의 마지막 부분입니다.

  sock = RPC_ANYSOCK;
  switch (p->p_proto)
    {
    case IPPROTO_UDP:
      tv.tv_sec = 5;
      tv.tv_usec = 0;
      client = INTUSE(clntudp_create) (&sin, prog, vers, tv, &sock);
      if (client == NULL)
        {
          return NULL;
        }
#if 0
      /* This is not wanted.  This would disable the user from having
         a timeout in the clnt_call() call.  Only a call to cnlt_control()
         by the user should set the timeout value.  */
      tv.tv_sec = 25;
      clnt_control (client, CLSET_TIMEOUT, (char *)&tv);
#endif
      break;
    case IPPROTO_TCP:
      client = INTUSE(clnttcp_create) (&sin, prog, vers, &sock, 0, 0);
      if (client == NULL)
        {
          return NULL;
        }
#if 0
      /* This is not wanted.  This would disable the user from having
         a timeout in the clnt_call() call.  Only a call to cnlt_control()
         by the user should set the timeout value.  */
      tv.tv_sec = 25;
      tv.tv_usec = 0;
      clnt_control (client, CLSET_TIMEOUT, (char *)&tv);
#endif
      break;
    default:
      {
        struct rpc_createerr *ce = &get_rpc_createerr ();
        ce->cf_stat = RPC_SYSTEMERROR;
        ce->cf_error.re_errno = EPFNOSUPPORT;
      }
      return (NULL);
    }
  return client;
}
INTDEF (clnt_create)

6번째 줄의 INTUSE와 마지막 줄의 INTDEF는 무엇을 말하는 것인가요?
익명 사용자의 이미지

sunrpc 디렉토리에 들어가서 gcc -c 파일이름 한다고 쉽게 컴파일 되지 않습니다.

make -C sunrpc

였던가... 암튼, 특정 subdirectory만을 선택적으로 컴파일 할 수 있는 방식이 있습니다.

그냥 전체 glibc를 make해보시고 그것을 log로 남겨보시면 어떤 방식으로 glibc가 컴파일 되는지 쉽게 아실 수 있을 듯

그리고, 예전 버전과의 호환을 위한 versioning기능을 컴파일 옵션을 통해서 빼면 glibc 사이즈가 줄어들지 않을까 합니다. (기억이 가물가물...)