Opened 4 years ago

Last modified 4 years ago

#5936 defect new

Building sendmsg.so on AIX requires extra define

Reported by: Michael Schlenker Owned by: Michael Schlenker
Priority: lowest Milestone:
Component: core Keywords: aix
Cc: Branch:
Author:

Description (last modified by Jean-Paul Calderone)

When building the 12.2.0 release with GCC on AIX, the symbols CMSG_SIZE and CMSG_LEN come up as undefined.

 twisted/python/sendmsg.c: In function 'sendmsg_sendmsg':
 twisted/python/sendmsg.c:243: warning: implicit declaration of function 'CMSG_SPACE'
 twisted/python/sendmsg.c:306: warning: implicit declaration of function 'CMSG_LEN'

Those symbols are only defined when _LINUX_SOURCE_COMPAT is defined on AIX.

Adding -D_LINUX_SOURCE_COMPAT to CFLAGS or in front of the sys/socket.h include fixes it.

Attachments (1)

sendmsg.c.aix.patch (475 bytes) - added by Michael Schlenker 4 years ago.
Patch to add _LINUX_SOURCE_COMPAT

Download all attachments as: .zip

Change History (7)

comment:1 Changed 4 years ago by Jean-Paul Calderone

Description: modified (diff)
Priority: lowlowest

Changed 4 years ago by Michael Schlenker

Attachment: sendmsg.c.aix.patch added

Patch to add _LINUX_SOURCE_COMPAT

comment:2 Changed 4 years ago by Thijs Triemstra

Keywords: review added

Putting the patch up for review. See ReviewProcess on how to get your patch reviewed.

comment:3 Changed 4 years ago by Jean-Paul Calderone

Keywords: aix, reviewaix review

Don't use "," in the keywords field.

comment:4 Changed 4 years ago by Jean-Paul Calderone

Keywords: review removed
Owner: set to Michael Schlenker

Compilation is nice. But how about the unit tests? Does the patch make them pass?

comment:5 Changed 4 years ago by Glyph

schlenk, thanks for submitting this fix, but it will be difficult for us to apply it without access to any AIX machines and especially without an AIX buildbot to verify that Twisted works at all. We don't support the AIX platform, and we can't really do so until someone has contributed hardware for a consistently-available buildbot. Would you be interested in contributing one, or, if we can come up with one of our own (for example, via the snakebite project) helping to administer our buildbot on that machine or helping us fix other issues that arise?

Thanks.

comment:6 Changed 4 years ago by Michael Schlenker

Just had a look at the Snakebite project, they actually have an AIX box (AIX 7.1) already, just no xlc (native) compiler license anymore. But twisted kind of works when built with gcc, just needs the native linker.

Sadly (well, not really sad about it, more trouble than its worth), we have decided to get rid of the AIX platform for new developments at work, so i could hardly argue for inclusion of the patch and effort spent on maintenance for AIX.

About tests: I tried to run the tests, but they hang while running some subprocess tests, didn't have time to analyze deeper. The network/web parts seem to work fine though (and we use them in production without any patches besides this one).

Note: See TracTickets for help on using tickets.