/usr/include/bits/waitstatus.h 관련한 error의 원인을 알고나니,...

wfellow의 이미지

정말 허탈하군요. pthread를 사용하는 소스에 vfork/exec를 사용하는 부분을 추가 하다가 아래와 같은 에러를 만났습니다.

Quote:
orange SQLAP # make
gcc -Wall -I. -I../LIB -I../SQLXX -I../SQLKM -I../SQLDB -I../SQLTL -c sqlap.c
In file included from /usr/include/sys/wait.h:79,
from sqlap.c:30:
/usr/include/bits/waitstatus.h:78: error: duplicate member `__w_retcode'
/usr/include/bits/waitstatus.h:79: error: duplicate member `__w_coredump'
/usr/include/bits/waitstatus.h:80: error: duplicate member `__w_termsig'
/usr/include/bits/waitstatus.h:92: error: duplicate member `__w_stopsig'
/usr/include/bits/waitstatus.h:93: error: duplicate member `__w_stopval'
make: *** [sqlap.o] Error 1
orange SQLAP #

통밥으로 생각해 보니 pthread_cond_signal과 함께 SIGCHLD에 대한 waitpid()를 함께 사용하니 clone관련해서 그럴수도 있으려니 하고 man을 보며 디버깅을 하다보니 엉뚱한 곳에서 원인이 나왔으니..

아래의 내용은 /usr/include/bits/waitstatus.h의 내용입니다.

Quote:

65 union wait
66 {
67 int w_status;
68 struct
69 {
70 # if __BYTE_ORDER == __LITTLE_ENDIAN
71 unsigned int __w_termsig:7; /* Terminating signal. */
72 unsigned int __w_coredump:1; /* Set if dumped core. */
73 unsigned int __w_retcode:8; /* Return code if exited normally. */
74 unsigned int:16;
75 # endif /* Little endian. */
76 # if __BYTE_ORDER == __BIG_ENDIAN
77 unsigned int:16;
78 unsigned int __w_retcode:8;
79 unsigned int __w_coredump:1;
80 unsigned int __w_termsig:7;
81 # endif /* Big endian. */
82 } __wait_terminated;
83 struct
84 {
85 # if __BYTE_ORDER == __LITTLE_ENDIAN
86 unsigned int __w_stopval:8; /* W_STOPPED if stopped. */
87 unsigned int __w_stopsig:8; /* Stopping signal. */
88 unsigned int:16;
89 # endif /* Little endian. */
90 # if __BYTE_ORDER == __BIG_ENDIAN
91 unsigned int:16;
92 unsigned int __w_stopsig:8; /* Stopping signal. */
93 unsigned int __w_stopval:8; /* W_STOPPED if stopped. */
94 # endif /* Big endian. */
95 } __wait_stopped;
96 };

위의 70, 76, 85, 90 라인의 # if __BYTE_ORDER == __LITTLE_ENDIAN 이 부분이 정상적으로 먹히질 않는군요.. 테스트를 위해 76-81, 90-94라인을 주석으로 막고(전 little endian) 컴팔을 하니 제대로 되는군요. ㅡ.ㅡd;
컴팔 옵션에서 __BYTE_ORDER를 정의 해주면 해결이더군요..

저랑 비슷한 삽질하신분들중 위의 내용을 다르게 해결 하신분이 혹시 계신가요?

ps: 이것땜에 저녁도 못먹고 토튼햄 경기도 못봤답니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.