Skip to content
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

AIX build is broken #15580

Closed
andrewkirillov-ibm opened this issue Nov 14, 2024 · 1 comment
Closed

AIX build is broken #15580

andrewkirillov-ibm opened this issue Nov 14, 2024 · 1 comment
Labels

Comments

@andrewkirillov-ibm
Copy link
Contributor

I did this

Building curl 8.11.0 on AIX system using XL C compiler:
https://www.ibm.com/docs/en/xl-c-and-cpp-aix/16.1?topic=cc-highly-configurable-compiler

export PATH=$PATH:/opt/IBM/xlc/16.1.0/bin
export CC=xlc_r
./configure --without-ssl --without-libpsl
make

This results in a failed build:

"var.h", line 30.8: 1506-334 (S) Identifier var has already been defined on line 64 of "/usr/include/sys/var.h".
make: The error code from the last command is 1.

The reason for this failure is a recent fix to #14880. In that fix we now include pthread.h from curl_setup.h The problem is that AIX systems have a sys/var.h system header. That header gets included through a chain with pthread.h. Also that header defines a "struct var" type. CURL also defines "struct var" in src/var.h. And so, as we now pull pthreads.h from one of the main curl headers, the system var structures conflicts with the curl's one.

I expected the following

Clean build

curl/libcurl version

8.11.0

operating system

AIX 7.2
IBM XL C/C++ for AIX, V16.1.0

@andrewkirillov-ibm
Copy link
Contributor Author

A quick dirty fix could be removing pthread.h from curl_setup.h, which proves to work. However:

  1. There was a reason it was done that way.
  2. It will only delay the problem. Once pthread.h and src/var.h get included together, we'll get back to the problem.

As struct var usage is limited mostly to var.c, I would suggest renaming the structure.

andrewkirillov-ibm added a commit to andrewkirillov-ibm/curl that referenced this issue Nov 14, 2024
Fixing issue curl#15580 by renaming struct var to curl_var to avoid conflict with the same structure name defined in AIX system headers.
andrewkirillov-ibm added a commit to andrewkirillov-ibm/curl that referenced this issue Nov 14, 2024
Fixing issue curl#15580 by renaming struct var to tool_var to avoid conflict with the same structure name defined in AIX system headers.
@vszakats vszakats added the build label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants