Opened 7 years ago
Closed 5 years ago
#54638 closed defect (fixed)
mesa @17.1.6_0: error: implicit declaration of function 'fstatat' is invalid in C99
Reported by: | tehcog (tehcog) | Owned by: | jeremyhu (Jeremy Huddleston Sequoia) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.4.1 |
Keywords: | tiger leopard snowleopard lion mountainlion mavericks | Cc: | rlhamil, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), devernay (Frédéric Devernay), mojca (Mojca Miklavec) |
Port: | mesa |
Description
mesa-17.1.6_0 will not build mp 2.4.1, Mavericks
Aug 18 15:19:58 NerdCenter === Update MacPorts Aug 18 15:19:58 NerdCenter ---> Updating MacPorts base sources using rsync Aug 18 15:20:03 NerdCenter MacPorts base version 2.4.1 installed, Aug 18 15:20:03 NerdCenter MacPorts base version 2.4.1 downloaded. Aug 18 15:20:03 NerdCenter ---> MacPorts base is already the latest version Aug 18 15:20:03 NerdCenter === Update Portfiles Aug 18 15:20:03 NerdCenter ---> Updating the ports tree Aug 18 15:20:10 NerdCenter Aug 18 15:20:10 NerdCenter === List Outdated Ports Aug 18 15:20:10 NerdCenter mesa @12.0.1_2+osmesa+python27 Aug 18 15:20:10 NerdCenter Aug 18 15:20:10 NerdCenter === Clean Outdated Ports Aug 18 15:20:10 NerdCenter ---> Cleaning mesa Aug 18 15:20:11 NerdCenter Aug 18 15:20:11 NerdCenter === Fetch Outdated Ports Aug 18 15:20:11 NerdCenter ---> Fetching distfiles for mesa Aug 18 15:20:11 NerdCenter Aug 18 15:20:11 NerdCenter === Upgrade Outdated Ports (port -p upgrade --enforce-variants outdated) Aug 18 15:20:14 NerdCenter ---> Computing dependencies for mesa Aug 18 15:20:14 NerdCenter ---> Fetching archive for mesa Aug 18 15:20:17 NerdCenter ---> Attempting to fetch mesa-17.1.6_0+osmesa+python27.darwin_13.x86_64.tbz2 from https://packages.macports.org/mesa Aug 18 15:20:17 NerdCenter ---> Attempting to fetch mesa-17.1.6_0+osmesa+python27.darwin_13.x86_64.tbz2 from http://lil.fr.packages.macports.org/mesa Aug 18 15:20:18 NerdCenter ---> Attempting to fetch mesa-17.1.6_0+osmesa+python27.darwin_13.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/mesa Aug 18 15:20:19 NerdCenter ---> Verifying checksums for mesa Aug 18 15:20:19 NerdCenter ---> Extracting mesa Aug 18 15:20:20 NerdCenter ---> Applying patches to mesa Aug 18 15:20:20 NerdCenter ---> Configuring mesa Aug 18 15:21:10 NerdCenter ---> Building mesa Aug 18 15:21:16 NerdCenter Error: Failed to build mesa: command execution failed Aug 18 15:21:16 NerdCenter Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_mesa/mesa/main.log for details. Aug 18 15:21:16 NerdCenter Error: Follow https://guide.macports.org/#project.tickets to report a bug. Aug 18 15:21:16 NerdCenter Aug 18 15:21:16 NerdCenter === List Inactive Duplicate Ports Aug 18 15:21:17 NerdCenter Aug 18 15:21:17 NerdCenter === Uninstall Inactive Duplicate Ports Aug 18 15:21:17 NerdCenter Error: No ports matched the given expression Aug 18 15:21:17 NerdCenter Aug 18 15:21:17 NerdCenter === Upgrade Done
Attachments (2)
Change History (25)
Changed 7 years ago by tehcog (tehcog)
comment:2 Changed 7 years ago by kencu (Ken)
No, it looks like a different error:
:info:build disk_cache.c:465:11: error: implicit declaration of function 'fstatat' is invalid in C99 [-Werror,-Wimplicit-function-declaration] 628 :info:build if (fstatat(dirfd(dir), entry->d_name, &sb, 0) == 0) { 629 :info:build ^ 630 :info:build 1 warning and 1 error generated.
comment:3 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Keywords: | tiger leopard snowleopard lion mountainlion mavericks added |
---|---|
Owner: | set to jeremyhu |
Status: | new → assigned |
Summary: | mesa-17.1.6_0 will not build mp 2.4.1, Mavericks → mesa @17.1.6_0: error: implicit declaration of function 'fstatat' is invalid in C99 |
According to man fstatat
on Sierra, "The fstatat()
system call appeared in OS X 10.10". So mesa will not build on earlier systems right now.
comment:4 Changed 7 years ago by rlhamil
Cc: | rlhamil added |
---|
comment:5 Changed 7 years ago by kencu (Ken)
If the plan is a replacement function for fstatat
, here are some ideas...
<https://opensource.apple.com/source/gnutar/gnutar-453/gnutar/lib/fstatat.c.auto.html> mmm. that is unfortunately not a replacement function.
Here's another, but GPL3: <https://github.com/cfengine/core/blob/master/libcompat/fstatat.c>
GPL2: <https://github.com/gittup/tup/blob/master/src/compat/fstatat.c>
This looks possibly promising; GPL2+: <https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=21&ved=0ahUKEwjIirD-lubVAhUQ22MKHSUjBoI4FBAWCCcwAA&url=http%3A%2F%2Fwww.mirrorservice.org%2Fpub%2FNetBSD%2FNetBSD-current%2Fsrc%2Fexternal%2Fgpl2%2Fxcvs%2Fdist%2Flib%2Fopenat.c&usg=AFQjCNGQ5Veqt1Y-XLCEkyEQFIz6Vwo-rg>
comment:6 Changed 7 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Cc: | MarcusCalhoun-Lopez added |
---|
comment:7 Changed 7 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
comment:8 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)
fstatat requires kernel support for proper functionality.
I wrote userland versions of them a few years ago and can use those without GPL taint.
Leaving this open as a reminder to fix that and revert the disabled code.
comment:9 Changed 7 years ago by devernay (Frédéric Devernay)
Cc: | devernay added |
---|
comment:10 Changed 7 years ago by mojca (Mojca Miklavec)
Cc: | mojca added |
---|
comment:11 Changed 7 years ago by mojca (Mojca Miklavec)
It looks like we need to rebuild wine-devel
at least. I can do that once I confirm that it works on one worker.
comment:12 Changed 6 years ago by kencu (Ken)
This a ping for Jeremy - If you still have those userland versions of fstatat
etc and might pop them up into your github repo perhaps, I'd be happy to see if I can get them rolled into the macports-legacy
portgroup and fix a few of these hangers-on.
comment:14 Changed 6 years ago by kencu (Ken)
That is great - thank you. I'll work with Chris if needed and get these rolled in to the legacy PG.
comment:15 Changed 6 years ago by kencu (Ken)
OK. This compiles without any particular issue. You need these added to <sys/fcntl.h>
, possibly without the initial guard, but probably with the guard:
#if __DARWIN_C_LEVEL >= 200809L /* * Descriptor value for the current working directory */ #define AT_FDCWD -2 /* * Flags for the at functions */ #define AT_EACCESS 0x0010 /* Use effective ids in access check */ #define AT_SYMLINK_NOFOLLOW 0x0020 /* Act on the symlink itself not the target */ #define AT_SYMLINK_FOLLOW 0x0040 /* Act on target of symlink */ #define AT_REMOVEDIR 0x0080 /* Path refers to directory */ #endif
you need to add a definition for getattrlistat
to avoid an implicit declaration error:
int getattrlistat(int dirfd, const char *pathname, struct attrlist *a, void *buf, size_t size, unsigned long flags);
and there is some secret sauce, info for which is found here <https://gist.github.com/bnoordhuis/4221344>
/* this is some apple internal magic */ #include <sys/syscall.h> #ifndef SYS___pthread_chdir # define SYS___pthread_chdir 348 #endif #ifndef SYS___pthread_fchdir # define SYS___pthread_fchdir 349 #endif int __pthread_chdir(const char *path) { return syscall(SYS___pthread_chdir, path); } int __pthread_fchdir(int dirfd) { return syscall(SYS___pthread_fchdir, dirfd); } /* extern int __pthread_fchdir(int fd); */
and then it compiles through to an object file without any troubles, at least on this 10.6.8 system I like to use, with clang-3.9 and libc++.
Perhaps Chris can help me come up with some test programs for it.
comment:16 Changed 6 years ago by kencu (Ken)
OK, it's done, at least to the point of testing. If anyone is interested, the new version that includes the *at functions is here:
<https://github.com/kencu/macports-legacy-support>
once we see if it fills the need and I didn't make any silly errors, we'll bump it to master.
comment:17 follow-up: 18 Changed 6 years ago by kencu (Ken)
seems to work:
util-linux @2.33_0 (active) platform='darwin 10' archs='x86_64' date='2018-11-21T00:35:40-0800'
now for some kind of way to really test it.
comment:18 Changed 6 years ago by tehcog (tehcog)
Replying to kencu:
now for some kind of way to really test it.
I have Mavericks, perhaps I can help. Just tell me what to do.
Regards
comment:19 Changed 6 years ago by kencu (Ken)
I think I will set up a -devel
option for the legacy-support port, so that people can more easily test these things out.
comment:20 Changed 6 years ago by kencu (Ken)
ok, it's online now. If you install
sudo port -v install legacy-support-devel +universal
you should then be able to work with ports that need fstatat
and pretty much all the other *at functions.
You'll need to add
PortGroup legacysupport 1.0
to the Portfile you want to work with, if it isn't there already.
Please help me fix up any errors you may come across.
comment:21 Changed 6 years ago by kencu (Ken)
My only real remaining question is Tiger -- I think the syscalls used in the *at function replacements use a kernel call that Tiger doesn't support, based on looking at the headers.
Appreciate any way around this anyone knows about.
comment:22 Changed 6 years ago by jeremyhu (Jeremy Huddleston Sequoia)
__DARWIN_C_LEVEL
gets setup by sys/cdefs.h. Older systems predate that. I think I added it in Lion, and the POSIX2008 support may have been later (Mountain Lion?). If you want to use the POSIX 2008 namespace guards, you'll also need to update sys/cdefs.h in your overlay.
comment:23 Changed 5 years ago by kencu (Ken)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
fixed along the way:
$ port -v installed mesa The following ports are currently installed: mesa @17.1.6_1+osmesa+python27 (active) platform='darwin 11' archs='x86_64' date='2018-09-06T20:47:47-0700'
main.log