Can't build v7-3-1189

695 views
Skip to first unread message

Christian Wellenbrock

unread,
Jun 14, 2013, 12:46:44 PM6/14/13
to vim...@googlegroups.com
I just cloned a completely new copy of the hg vim sources and called make from the src folder. I get the following errors: https://gist.github.com/wellle/5783452/raw/b7b02012331575f646b5bb09246329947ae7eb44/gistfile1.txt

Bram Moolenaar

unread,
Jun 14, 2013, 1:16:16 PM6/14/13
to Christian Wellenbrock, vim...@googlegroups.com
Check the definition of MAC_OS_X_VERSION_MAX_ALLOWED
This line is only supposed to be included for some old OSX version.

--
Some of the well known MS-Windows errors:
EMEMORY Memory error caused by..., eh...
ELICENSE Your license has expired, give us more money!
EMOUSE Mouse moved, reinstall Windows
EILLEGAL Illegal error, you are not allowed to see this
EVIRUS Undetectable virus found

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Christian Wellenbrock

unread,
Jun 14, 2013, 1:37:41 PM6/14/13
to vim...@googlegroups.com, Christian Wellenbrock
MAC_OS_X_VERSION_MAX_ALLOWED doesn't seem to be defined. I searched the whole vim directory and could only find the following two lines in src/os_unix.c. Where is it supposed to be defined?

vim hg:default ❱ ag -a VERSION_MAX
src/os_unix.c
826:# if defined(__APPLE__) && (!defined(MAC_OS_X_VERSION_MAX_ALLOWED) \
827: || MAC_OS_X_VERSION_MAX_ALLOWED <= 1040)
vim hg:default ❱

Bram Moolenaar

unread,
Jun 14, 2013, 3:15:48 PM6/14/13
to Christian Wellenbrock, vim...@googlegroups.com

Christian Wellenbrock wrote:

> > > I just cloned a completely new copy of the hg vim sources and called
> > > make from the src folder. I get the following errors:
> >
> > > https://gist.github.com/wellle/5783452/raw/b7b02012331575f646b5bb09246329947ae7eb44/gistfile1.txt
> >
> >
> >
> > Check the definition of MAC_OS_X_VERSION_MAX_ALLOWED
> > This line is only supposed to be included for some old OSX version.
>
> MAC_OS_X_VERSION_MAX_ALLOWED doesn't seem to be defined. I searched the whole vim directory and could only find the following two lines in src/os_unix.c. Where is it supposed to be defined?
>
> vim hg:default ❱ ag -a VERSION_MAX
> src/os_unix.c
> 826:# if defined(__APPLE__) && (!defined(MAC_OS_X_VERSION_MAX_ALLOWED) \
> 827: || MAC_OS_X_VERSION_MAX_ALLOWED <= 1040)
> vim hg:default ❱

Could be defined in a header file, or by the compiler itself.
Try this:

gcc -dM -E - < /dev/null

If MAC_OS_X_VERSION_MAX_ALLOWED is no longer defined, perhaps there is
another one to identify the OSX version?

--
hundred-and-one symptoms of being an internet addict:
199. You read this entire list of symptoms, looking for something
that doesn't describe you.

Christian Wellenbrock

unread,
Jun 14, 2013, 3:22:18 PM6/14/13
to vim...@googlegroups.com, Christian Wellenbrock
MAC_OS_X_VERSION_MAX_ALLOWED is indeed not included in the resulting list of defines:

https://gist.github.com/wellle/5784475/raw/e04d59e291a4fba221469d9816dbd2008f99cbeb/gistfile1.txt

Manuel Ortega

unread,
Jun 14, 2013, 4:35:59 PM6/14/13
to vim...@googlegroups.com
Buried in that gist file is a line that shows the OP is using a beta version of XCode5, which won't come out until OS X 10.9 comes out.  Possibly the OP is building on a beta of OSX10.9 as well.  If you look at the issues page of, e.g., the homebrew website (https://github.com/mxcl/homebrew/issues), you will see that the OSX 10.9 and XCode5 betas are *full* of stupid bugs that are affecting all kinds of programs.  I'd bet that the problem is the beta(s), and not vim.

-Manny

Christian Wellenbrock

unread,
Jun 14, 2013, 5:02:26 PM6/14/13
to vim...@googlegroups.com
Well spotted! I was trying out the iOS 7 beta, but not Mac OS 10.9. I'm still on 10.8.4, but this is most likely still be the cause for this issue. I will have to find a workaround for now. Thank you!

Tryn Mirell

unread,
Jun 15, 2013, 10:37:06 AM6/15/13
to vim...@googlegroups.com
I'm sure there's a far better way dealing with the preprocessors, but here's a simple patch attached that got vim to compile and work for me.

This code path probably didn't get hit for quite a while, at least since 10.4. And since 10.5, that particular system call takes a separate type of variable, stack_t, rather than sigalstack. Confirmed by looking at https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/10.5/man2/sigaltstack.2.html

However, I will note, that perhaps a better fix is adding the following:
#include <Availability.h>

That gets you the following:
<snip>
#define __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 1090
#define __MACH__ 1
#define __MAC_10_0 1000
#define __MAC_10_1 1010
#define __MAC_10_2 1020
#define __MAC_10_3 1030
#define __MAC_10_4 1040
#define __MAC_10_5 1050
#define __MAC_10_6 1060
#define __MAC_10_7 1070
#define __MAC_10_8 1080
#define __MAC_10_9 1090
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_10_9
#define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
<snip>

I also note one of the more common header files, stdio.h, has an #include for Availability.h.

I believe this has to with the complete conversion from LLVM+GCC to clang with XCode 5's SDK:

OS 10.9:
mirell at chibi ~/src/bitbucket gcc --version
Configured with: --prefix=/Applications/Xcode5-DP.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.1.58) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0

OS 10.8:
gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


In any case, it's too soon to tell whether they'll reinclude those variables for future releases, however I think making the patch inline with what the current headers define the struct as will suffice.

Thanks!

--
Tryn Mirell
tr...@mirell.org
https://mirell.org
vim-sigalstack.patch

Manuel Ortega

unread,
Jun 15, 2013, 10:05:36 PM6/15/13
to vim...@googlegroups.com
On Fri, Jun 14, 2013 at 5:02 PM, Christian Wellenbrock <christian....@gmail.com> wrote:
On Friday, June 14, 2013 10:35:59 PM UTC+2, Manuel Ortega wrote:
> Buried in that gist file is a line that shows the OP is using a beta version of XCode5, which won't come out until OS X 10.9 comes out.  Possibly the OP is building on a beta of OSX10.9 as well.  If you look at the issues page of, e.g., the homebrew website (https://github.com/mxcl/homebrew/issues), you will see that the OSX 10.9 and XCode5 betas are *full* of stupid bugs that are affecting all kinds of programs.  I'd bet that the problem is the beta(s), and not vim.

Well spotted! I was trying out the iOS 7 beta, but not Mac OS 10.9. I'm still on 10.8.4, but this is most likely still be the cause for this issue. I will have to find a workaround for now. Thank you!

Homebrew now claims to have fixed, in principle, the main problems with XCode5 Beta and 10.9 Beta.  You might cherry pick this stuff and see if it works, particularly the patch to src/os_unix.c.


-Manny

Tryn Mirell

unread,
Jun 16, 2013, 7:37:32 AM6/16/13
to vim...@googlegroups.com

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
 
---
You received this message because you are subscribed to a topic in the Google Groups "vim_dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_dev/YHo51sA46fU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

They fixed it by doing it the other way I suggested, including Availability.h: (Well, AvailabilityMacros.h, but it sill gets there)

+--- a/src/os_unix.c  2013-06-13 16:50:33.000000000 +0200
++++ b/src/os_unix.c  2013-06-13 16:50:40.000000000 +0200
+@@ -18,6 +18,10 @@
+  * changed beyond recognition.
+  */
++#if defined(__APPLE__)
++#include <AvailabilityMacros.h>
++#endif

That ends up defining the MAC_OS_X_MIN_VERSION

I still think that's messy.

(They also had different issues unrelated to vim-core for MacVim).

I just did this:

diff -r c1170f618303 src/os_unix.c
--- a/src/os_unix.c     Fri Jun 14 22:48:54 2013 +0200
+++ b/src/os_unix.c     Sat Jun 15 09:04:55 2013 -0500
@@ -827,7 +827,7 @@
                || MAC_OS_X_VERSION_MAX_ALLOWED <= 1040)
        /* missing prototype.  Adding it to osdef?.h.in doesn't work, because
         * "struct sigaltstack" needs to be declared. */
-       extern int sigaltstack __ARGS((const struct sigaltstack *ss, struct sigaltstack *oss));
+    extern int sigaltstack __ARGS((const stack_t *restrict ss, stack_t *restrict oss));
 #  endif

 #  ifdef HAVE_SS_BASE

--
===================
| Tryn Mirell     |
| tr...@mirell.org |
| +1.512.796.3592 |
===================

"Even imperfection itself may have its ideal or perfect state." 
Thomas de Quincey 
Reply all
Reply to author
Forward
0 new messages