Skip to content

Commit a25df3f

Browse files
committed
opal: Remove outdated MacOS workaround
Remove the pack/unpack pragma around net/if.h on MacOS, which was added to fix a bug in MacOS X 10.4.x on 64-bit platforms. The bug was fixed in Mac OS X 10.5.0 and, sometime in the last 11 years, compilers started emitting warnings about the fact that the Apple header stomped over the pragma pack settings from the workaround. We already don't support versions of MacOS earlier than 10.5, so there's no point in keeping the workaround. Signed-off-by: Brian Barrett <[email protected]>
1 parent b2ee56a commit a25df3f

File tree

6 files changed

+11
-81
lines changed

6 files changed

+11
-81
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Copyright (c) 2014-2015 Hewlett-Packard Development Company, LP. All
5353
rights reserved.
5454
Copyright (c) 2013-2017 Research Organization for Information Science (RIST).
5555
All rights reserved.
56-
Copyright (c) 2017 Amazon.com, Inc. or its affiliates. All Rights
56+
Copyright (c) 2017-2018 Amazon.com, Inc. or its affiliates. All Rights
5757
reserved.
5858
Copyright (c) 2018 DataDirect Networks. All rights reserved.
5959

opal/mca/if/bsdx_ipv6/if_bsdx_ipv6.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
22
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
33
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights
5+
* reserved.
46
* $COPYRIGHT$
57
*
68
* Additional copyrights may follow
@@ -36,23 +38,7 @@
3638
#include <arpa/inet.h>
3739
#endif
3840
#ifdef HAVE_NET_IF_H
39-
#if defined(__APPLE__) && defined(_LP64)
40-
/* Apple engineering suggested using options align=power as a
41-
workaround for a bug in OS X 10.4 (Tiger) that prevented ioctl(...,
42-
SIOCGIFCONF, ...) from working properly in 64 bit mode on Power PC.
43-
It turns out that the underlying issue is the size of struct
44-
ifconf, which the kernel expects to be 12 and natural 64 bit
45-
alignment would make 16. The same bug appears in 64 bit mode on
46-
Intel macs, but align=power is a no-op there, so instead, use the
47-
pack pragma to instruct the compiler to pack on 4 byte words, which
48-
has the same effect as align=power for our needs and works on both
49-
Intel and Power PC Macs. */
50-
#pragma pack(push,4)
51-
#endif
5241
#include <net/if.h>
53-
#if defined(__APPLE__) && defined(_LP64)
54-
#pragma pack(pop)
55-
#endif
5642
#endif
5743
#ifdef HAVE_NETDB_H
5844
#include <netdb.h>

opal/mca/if/if.h

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright (c) 2010-2013 Cisco Systems, Inc. All rights reserved.
44
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
55
* reserved.
6+
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights
7+
* reserved.
68
* $COPYRIGHT$
79
*
810
* Additional copyrights may follow
@@ -39,23 +41,7 @@
3941
#include <arpa/inet.h>
4042
#endif
4143
#ifdef HAVE_NET_IF_H
42-
#if defined(__APPLE__) && defined(_LP64)
43-
/* Apple engineering suggested using options align=power as a
44-
workaround for a bug in OS X 10.4 (Tiger) that prevented ioctl(...,
45-
SIOCGIFCONF, ...) from working properly in 64 bit mode on Power PC.
46-
It turns out that the underlying issue is the size of struct
47-
ifconf, which the kernel expects to be 12 and natural 64 bit
48-
alignment would make 16. The same bug appears in 64 bit mode on
49-
Intel macs, but align=power is a no-op there, so instead, use the
50-
pack pragma to instruct the compiler to pack on 4 byte words, which
51-
has the same effect as align=power for our needs and works on both
52-
Intel and Power PC Macs. */
53-
#pragma pack(push,4)
54-
#endif
5544
#include <net/if.h>
56-
#if defined(__APPLE__) && defined(_LP64)
57-
#pragma pack(pop)
58-
#endif
5945
#endif
6046
#ifdef HAVE_NETDB_H
6147
#include <netdb.h>

opal/mca/if/linux_ipv6/if_linux_ipv6.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
22
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
33
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights
5+
* reserved.
46
* $COPYRIGHT$
57
*
68
* Additional copyrights may follow
@@ -34,23 +36,7 @@
3436
#include <arpa/inet.h>
3537
#endif
3638
#ifdef HAVE_NET_IF_H
37-
#if defined(__APPLE__) && defined(_LP64)
38-
/* Apple engineering suggested using options align=power as a
39-
workaround for a bug in OS X 10.4 (Tiger) that prevented ioctl(...,
40-
SIOCGIFCONF, ...) from working properly in 64 bit mode on Power PC.
41-
It turns out that the underlying issue is the size of struct
42-
ifconf, which the kernel expects to be 12 and natural 64 bit
43-
alignment would make 16. The same bug appears in 64 bit mode on
44-
Intel macs, but align=power is a no-op there, so instead, use the
45-
pack pragma to instruct the compiler to pack on 4 byte words, which
46-
has the same effect as align=power for our needs and works on both
47-
Intel and Power PC Macs. */
48-
#pragma pack(push,4)
49-
#endif
5039
#include <net/if.h>
51-
#if defined(__APPLE__) && defined(_LP64)
52-
#pragma pack(pop)
53-
#endif
5440
#endif
5541
#ifdef HAVE_NETDB_H
5642
#include <netdb.h>

opal/util/if.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* reserved.
1717
* Copyright (c) 2015-2016 Research Organization for Information Science
1818
* and Technology (RIST). All rights reserved.
19+
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights
20+
* reserved.
1921
* $COPYRIGHT$
2022
*
2123
* Additional copyrights may follow
@@ -49,23 +51,7 @@
4951
#include <arpa/inet.h>
5052
#endif
5153
#ifdef HAVE_NET_IF_H
52-
#if defined(__APPLE__) && defined(_LP64)
53-
/* Apple engineering suggested using options align=power as a
54-
workaround for a bug in OS X 10.4 (Tiger) that prevented ioctl(...,
55-
SIOCGIFCONF, ...) from working properly in 64 bit mode on Power PC.
56-
It turns out that the underlying issue is the size of struct
57-
ifconf, which the kernel expects to be 12 and natural 64 bit
58-
alignment would make 16. The same bug appears in 64 bit mode on
59-
Intel macs, but align=power is a no-op there, so instead, use the
60-
pack pragma to instruct the compiler to pack on 4 byte words, which
61-
has the same effect as align=power for our needs and works on both
62-
Intel and Power PC Macs. */
63-
#pragma pack(push,4)
64-
#endif
6554
#include <net/if.h>
66-
#if defined(__APPLE__) && defined(_LP64)
67-
#pragma pack(pop)
68-
#endif
6955
#endif
7056
#ifdef HAVE_NETDB_H
7157
#include <netdb.h>

opal/util/net.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Copyright (c) 2013 Intel, Inc. All rights reserved.
1616
* Copyright (c) 2015 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
18+
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights
19+
* reserved.
1820
* $COPYRIGHT$
1921
*
2022
* Additional copyrights may follow
@@ -49,23 +51,7 @@
4951
#include <arpa/inet.h>
5052
#endif
5153
#ifdef HAVE_NET_IF_H
52-
#if defined(__APPLE__) && defined(_LP64)
53-
/* Apple engineering suggested using options align=power as a
54-
workaround for a bug in OS X 10.4 (Tiger) that prevented ioctl(...,
55-
SIOCGIFCONF, ...) from working properly in 64 bit mode on Power PC.
56-
It turns out that the underlying issue is the size of struct
57-
ifconf, which the kernel expects to be 12 and natural 64 bit
58-
alignment would make 16. The same bug appears in 64 bit mode on
59-
Intel macs, but align=power is a no-op there, so instead, use the
60-
pack pragma to instruct the compiler to pack on 4 byte words, which
61-
has the same effect as align=power for our needs and works on both
62-
Intel and Power PC Macs. */
63-
#pragma pack(push,4)
64-
#endif
6554
#include <net/if.h>
66-
#if defined(__APPLE__) && defined(_LP64)
67-
#pragma pack(pop)
68-
#endif
6955
#endif
7056
#ifdef HAVE_NETDB_H
7157
#include <netdb.h>

0 commit comments

Comments
 (0)