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

Build fails on macOS 11 #4350

Closed
genericptr opened this issue May 1, 2021 · 7 comments
Closed

Build fails on macOS 11 #4350

genericptr opened this issue May 1, 2021 · 7 comments
Assignees
Milestone

Comments

@genericptr
Copy link

Any ideas how to resolve this?

Screen Shot 2021-05-01 at 10 15 02 AM

build$ CC=../build-scripts/gcc-fat.sh ../configure ; make
checking build system type... i386-apple-darwin20.3.0
checking host system type... i386-apple-darwin20.3.0
checking how to print strings... printf
checking for gcc... ../build-scripts/gcc-fat.sh
checking whether the C compiler works... no
configure: error: in `~/Downloads/sdl/build':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.
@icculus
Copy link
Collaborator

icculus commented May 1, 2021

The script is trying to build a 32-bit Intel version, which Xcode no longer supports.

We need to update this to do only 64-bit Intel and 64-bit ARM.

@icculus
Copy link
Collaborator

icculus commented May 1, 2021

(For now: just don't use gcc-fat.)

@icculus icculus added this to the 2.0.16 milestone May 1, 2021
@icculus icculus self-assigned this May 1, 2021
@genericptr
Copy link
Author

Makes sense, thanks. Is there any alternative script you can suggest? All mac users on 10.15+ are 64-bit only now so we're kind of stuck.

@icculus icculus closed this as completed in 56e9625 Jun 9, 2021
@icculus
Copy link
Collaborator

icculus commented Jun 9, 2021

Try this with clang-fat.sh, which I just added. Same idea, but it works with 64-bit Intel and 64-bit ARM on Big Sur.

(the x86_64 part of the final build will work back to macOS 10.6, the arm64 part needs macOS 11.0.)

@genericptr
Copy link
Author

I tried the default command from the wiki and it seems to have built now but I don't see where the library is. Is this the same as clang-fat.sh?

cd SDL
mkdir build
cd build
../configure
make
sudo make install```

then I tried this:

build$ CC=../build-scripts/clang-fat.sh ../configure ; make

And got errors...

/Users/ryanjoseph/Downloads/SDL/src/video/x11/SDL_x11events.c:676:13: error: 
      invalid operands to binary expression ('int (Display *, XEvent *, int
      (*)(Display *, XEvent *, XPointer), XPointer)' (aka 'int (struct _XDisplay
      *, union _XEvent *, int (*)(struct _XDisplay *, union _XEvent *, char *),
      char *)') and 'XEvent *' (aka 'union _XEvent *'))
    XkbEvent* xkbEvent = (XkbEvent*) xevent;
    ~~~~~~~~^ ~~~~~~~~
/Users/ryanjoseph/Downloads/SDL/src/video/x11/SDL_x11events.c:676:36: error: 
      expected expression
    XkbEvent* xkbEvent = (XkbEvent*) xevent;
                                   ^
/Users/ryanjoseph/Downloads/SDL/src/video/x11/SDL_x11events.c:676:27: error: use
      of undeclared identifier 'XkbEvent'
    XkbEvent* xkbEvent = (XkbEvent*) xevent;
                          ^
/Users/ryanjoseph/Downloads/SDL/src/video/x11/SDL_x11events.c:766:53: error: use
      of undeclared identifier 'xkbEvent'
        } else if (xevent->type == MappingNotify || xkbEvent->any.xkb_typ...
                                                    ^
/Users/ryanjoseph/Downloads/SDL/src/video/x11/SDL_x11events.c:766:79: error: use
      of undeclared identifier 'XkbStateNotify'
  ...if (xevent->type == MappingNotify || xkbEvent->any.xkb_type == XkbStateNot...
                                                                    ^
7 errors generated.

@genericptr
Copy link
Author

I made a new issue for this. #4433

@icculus
Copy link
Collaborator

icculus commented Jun 9, 2021

but I don't see where the library is.

Assuming sudo make install worked, it copied it into /usr/local/lib/libSDL2-2.0.0.dylib (and it should be a Universal Binary if everything went right).

If you didn't want it installed system-wide, it should be sitting under your "build" directory in build/.libs/libSDL2-2.0.0.dylib (yes, that's build/build/.libs) before the sudo make install command, and you can just grab it directly.

The first steps you listed (without the CC=../build-scripts/clang-fat.sh part) will work, but they'll only build for the current architecture (arm64 on an M1 mac, x86_64 on the Intel macs). If building for your own personal use, this is actually what you want. All the tapdancing to build universal binaries and things that are compatible with older macOS releases is just if you intend to distribute the build to other people and want maximum compatibility, of course.

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

No branches or pull requests

2 participants