* [Tarantool-patches] [PATCH decNumber 1/1] Fix build on Mac with gcc and XCode 11
@ 2019-12-01 21:01 Vladislav Shpilevoy
2019-12-10 14:13 ` Kirill Yukhin
0 siblings, 1 reply; 3+ messages in thread
From: Vladislav Shpilevoy @ 2019-12-01 21:01 UTC (permalink / raw)
To: tarantool-patches, kyukhin
There is a bug in XCode 11 which makes some standard C headers
not self sufficient. At least <stdlib.h> and <algorithm> are
affected. When they are included first, compilation fails with
creepy errors like this:
In file included
from /Applications/Xcode.app/Contents/Developer/
Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
sys/wait.h:110,
from /Applications/Xcode.app/Contents/Developer/
Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
stdlib.h:66,
from /Users/gerold/Work/Repositories/tarantool/third_party/
zstd/lib/common/zstd_common.c:16:
/Applications/Xcode.app/Content/Developer/
Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
sys/resource.h:
In function 'getiopolicy_np': /Applications/Xcode.app/Contents/Developer/
Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
sys/resource.h:447:34: error:
expected declaration specifiers before '__OSX_AVAILABLE_STARTING'
447 | int getiopolicy_np(int, int)
__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
The patch workarounds the bug by changing header include order.
Part of https://github.com/tarantool/tarantool/issues/4580
---
Issue: https://github.com/tarantool/tarantool/issues/4580
Branch: https://github.com/tarantool/decNumber/tree/gerold103/mac-build-gcc
Note, the branch depends on another branch in decNumber
repository. decNumber should be pushed first, then this branch
should be updated to look at the newest decNumber.
Discussion of the same issue from which I took the workaround:
https://github.com/Homebrew/homebrew-core/issues/44579
decNumber.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/decNumber.c b/decNumber.c
index e8947fe..85deb13 100644
--- a/decNumber.c
+++ b/decNumber.c
@@ -162,9 +162,9 @@
/* ** -- raise to the power */
/* ------------------------------------------------------------------ */
+#include <string.h> // for strcpy
#include <stdlib.h> // for malloc, free, etc.
#include <stdio.h> // for printf [if needed]
-#include <string.h> // for strcpy
#include <ctype.h> // for lower
#include "decNumber.h" // base number library
#include "decNumberLocal.h" // decNumber local types, etc.
--
2.21.0 (Apple Git-122.2)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Tarantool-patches] [PATCH decNumber 1/1] Fix build on Mac with gcc and XCode 11
2019-12-01 21:01 [Tarantool-patches] [PATCH decNumber 1/1] Fix build on Mac with gcc and XCode 11 Vladislav Shpilevoy
@ 2019-12-10 14:13 ` Kirill Yukhin
2020-01-24 2:19 ` Alexander Turenko
0 siblings, 1 reply; 3+ messages in thread
From: Kirill Yukhin @ 2019-12-10 14:13 UTC (permalink / raw)
To: Vladislav Shpilevoy; +Cc: tarantool-patches
Hello,
On 01 дек 22:01, Vladislav Shpilevoy wrote:
> There is a bug in XCode 11 which makes some standard C headers
> not self sufficient. At least <stdlib.h> and <algorithm> are
> affected. When they are included first, compilation fails with
> creepy errors like this:
>
> In file included
> from /Applications/Xcode.app/Contents/Developer/
> Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
> sys/wait.h:110,
> from /Applications/Xcode.app/Contents/Developer/
> Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
> stdlib.h:66,
> from /Users/gerold/Work/Repositories/tarantool/third_party/
> zstd/lib/common/zstd_common.c:16:
> /Applications/Xcode.app/Content/Developer/
> Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
> sys/resource.h:
> In function 'getiopolicy_np': /Applications/Xcode.app/Contents/Developer/
> Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
> sys/resource.h:447:34: error:
> expected declaration specifiers before '__OSX_AVAILABLE_STARTING'
> 447 | int getiopolicy_np(int, int)
> __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
>
> The patch workarounds the bug by changing header include order.
> Part of https://github.com/tarantool/tarantool/issues/4580
Checked into master and bumped new version in Tarantool.
--
Regards, Kirill Yukhin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Tarantool-patches] [PATCH decNumber 1/1] Fix build on Mac with gcc and XCode 11
2019-12-10 14:13 ` Kirill Yukhin
@ 2020-01-24 2:19 ` Alexander Turenko
0 siblings, 0 replies; 3+ messages in thread
From: Alexander Turenko @ 2020-01-24 2:19 UTC (permalink / raw)
To: Kirill Yukhin; +Cc: tarantool-patches, Vladislav Shpilevoy
On Tue, Dec 10, 2019 at 05:13:05PM +0300, Kirill Yukhin wrote:
> Hello,
>
> On 01 дек 22:01, Vladislav Shpilevoy wrote:
> > There is a bug in XCode 11 which makes some standard C headers
> > not self sufficient. At least <stdlib.h> and <algorithm> are
> > affected. When they are included first, compilation fails with
> > creepy errors like this:
> >
> > In file included
> > from /Applications/Xcode.app/Contents/Developer/
> > Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
> > sys/wait.h:110,
> > from /Applications/Xcode.app/Contents/Developer/
> > Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
> > stdlib.h:66,
> > from /Users/gerold/Work/Repositories/tarantool/third_party/
> > zstd/lib/common/zstd_common.c:16:
> > /Applications/Xcode.app/Content/Developer/
> > Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
> > sys/resource.h:
> > In function 'getiopolicy_np': /Applications/Xcode.app/Contents/Developer/
> > Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
> > sys/resource.h:447:34: error:
> > expected declaration specifiers before '__OSX_AVAILABLE_STARTING'
> > 447 | int getiopolicy_np(int, int)
> > __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
> >
> > The patch workarounds the bug by changing header include order.
> > Part of https://github.com/tarantool/tarantool/issues/4580
>
> Checked into master and bumped new version in Tarantool.
Are there a reason to don't push the bugfix to 2.2?
It will prevent clean applying of future updates of the submodule, so I
would prefer to update it everywhere.
WBR, Alexander Turenko.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-24 2:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-01 21:01 [Tarantool-patches] [PATCH decNumber 1/1] Fix build on Mac with gcc and XCode 11 Vladislav Shpilevoy
2019-12-10 14:13 ` Kirill Yukhin
2020-01-24 2:19 ` Alexander Turenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox