New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error compiling on c-ares AIX #224

Closed
amandeepgautam opened this Issue Oct 1, 2018 · 7 comments

Comments

Projects
None yet
2 participants
@amandeepgautam

amandeepgautam commented Oct 1, 2018

When trying to compile on AIX, I see the following error:

In file included from /tmp/aix_softwares/cares-1.14.0/ares_parse_a_reply.c:34:
/usr/include/arpa/nameser_compat.h:244:3: error: conflicting types for 'HEADER'
 } HEADER;
   ^~~~~~
In file included from /usr/include/arpa/nameser.h:645,
                 from /tmp/aix_softwares/cares-1.14.0/ares_parse_a_reply.c:29:
/usr/include/arpa/onameser_compat.h:265:3: note: previous declaration of 'HEADER' was here
 } HEADER;
   ^~~~~~

To compile, I did the following:

cd /path/to/cmake/source
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/cares ..

Any suggestions on how to solve the problem? I would be willing to send a PR for this, if suggestion is given. Problem seems to be that on AIX both these HEADER is defined in both .h files. Please let me know.

@bradh352

This comment has been minimized.

Member

bradh352 commented Oct 10, 2018

What version of AIX are you running? What version of c-ares are you testing (e.g. official 1.14.0 release, git master, etc)?

In my AIX version, at the top of nameser.h is a #define BIND_4_COMPAT which causes nameser_compat.h to be included if _USE_IRS is also defined. That said, I don't see anything setting _USE_IRS so onameser_compat.h would be included.

#ifdef _USE_IRS
#ifdef BIND_4_COMPAT
#include <arpa/nameser_compat.h>
#endif /* BIND_4_COMPAT */
#else /* _USE_IRS */
#include <arpa/onameser_compat.h>
#endif /* _USE_IRS */

So if things have changed on more recent versions of AIX we'd need to know how. Its possible it simply isn't appropriate to include arpa/nameser_compat.h manually any longer on AIX. Either that or previously we really should have just done
#define _USE_IRS
rather than manually including nameser_compat.h.

@amandeepgautam

This comment has been minimized.

amandeepgautam commented Oct 10, 2018

I am using AIX 7200-01-03-1720 and official release 1.14.0 release.
Following is how the two files look on this versions of AIX:
https://pastebin.com/c9VZPwGn
https://pastebin.com/WcjMnffk

@bradh352

This comment has been minimized.

Member

bradh352 commented Oct 10, 2018

basically looks the same, not sure why I'm not seeing that same issue on AIX 5. I really think the solution is to set _USE_IRS on AIX. I wonder if autotools doesn't already set that flag and its just something we ned to add to cmake.

@amandeepgautam

This comment has been minimized.

amandeepgautam commented Oct 12, 2018

@bradh352 I am very unfamiliar with the code base but if you could explain in more detail, i could give it a try and test it.

bradh352 added a commit that referenced this issue Oct 12, 2018

AIX Build Fix
AIX attempts to include both nameser_compat.h and onameser_compat.h.  It appears
the proper fix is to define _USE_IRS so that only nameser_compat.h is used.

Bug: #224
Fix By: Brad House (@bradh352)
@bradh352

This comment has been minimized.

Member

bradh352 commented Oct 12, 2018

If you try the current git master, I've made the change for the CMakeLists.txt to define _USE_IRS on AIX.

@amandeepgautam

This comment has been minimized.

amandeepgautam commented Oct 13, 2018

@bradh352 yes that compiles. Thanks for fixing this.
However, it only generates 32-bit lib? How could we generate 64-bit libs?

@bradh352

This comment has been minimized.

Member

bradh352 commented Oct 15, 2018

That's just whatever your compiler and tools default to. No build system ever builds both 32bit and 64bit.

From what I recall though, on AIX, pretty much everything honors the OBJECT_MODE environment variable and the valid values are/were 32 or 64.

@bradh352 bradh352 closed this Oct 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment