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

Support for AIX #1007

Merged
merged 6 commits into from
Nov 12, 2015
Merged

Support for AIX #1007

merged 6 commits into from
Nov 12, 2015

Conversation

mikesep
Copy link
Contributor

@mikesep mikesep commented Aug 19, 2015

These changes add support for the AIX platform.

In our AIX 7 environment, the SubprocessTest.InterruptChild test does not pass due to the /bin/sh shell being a really old version of ksh. I'll address the issue of using a different shell in a separate pull request.

/bin/od on Solaris and AIX both generate tabs.
On AIX, inttypes.h gets indirectly included by build_log.h.
It's easiest just to ask for the printf format macros right away.
AIX supplies getopt but not getopt_long.

We can't use the embedded getopt implementation, since the constness of its
arguments doesn't match the AIX system routine.
@@ -12,6 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// On AIX, inttypes.h gets indirectly included by build_log.h.
// It's easiest just to ask for the printf format macros right away.
#ifndef _WIN32
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this check for _WIN32 or _MSC_VER? Would MinGW want the __STDC_FORMAT_MACROS define?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simply moved the #define up from lower down the file. It was previously guarded by #ifndef _WIN32.

@nico
Copy link
Collaborator

nico commented Aug 20, 2015

Can you investigate a bit why the segfault happens?

@mikesep
Copy link
Contributor Author

mikesep commented Sep 9, 2015

Sorry for the lack of response here. I investigated the "segfault" a bit more, and it turns out that that was a bad description. In our AIX environment, I see different behaviors depending on the filesystem where the executable file runs. On NFS, I get Illegal instruction (core dumped) when I overwrite an executable file that's running. On non-NFS (SAN), AIX stops me from overwriting the file:

$ cp looper.cpp /tmp/looper
cp: try to overwrite '/tmp/looper', overriding mode 0755 (rwxr-xr-x)? y
cp: cannot create regular file '/tmp/looper': Text file busy

@mikesep
Copy link
Contributor Author

mikesep commented Oct 5, 2015

Hi @nico and @martine, I'd appreciate if you could take another look here. I'm still pretty certain that most of these changes are good.

Per my last comment in the unlink subthread, are you okay with that approach, and should I add an os.unlink(bootstrap_exe) line?

AIX does not support rebuilding ninja in-place from the bootstrapped ninja.
@mikesep
Copy link
Contributor Author

mikesep commented Oct 22, 2015

Force-pushed an update to the last commit to avoid the extra ninja.bootstrap where not needed.

evmar added a commit that referenced this pull request Nov 12, 2015
@evmar evmar merged commit 4ffe56d into ninja-build:master Nov 12, 2015
@nico
Copy link
Collaborator

nico commented Nov 12, 2015

Thanks for sticking with us, very sorry about the delay, and thanks for tirelessly iterating on this.

@mikesep
Copy link
Contributor Author

mikesep commented Nov 18, 2015

Thanks for merging! 😄

@mikesep mikesep deleted the aix branch November 18, 2015 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants