F_FLOCKW and F_FLOCK are undefined symbols in SPARC build
In building a recent version of illumos on my T2000 (sun4v SPARC), I encountered these errors:
"../libc/sys/common/flock.c", line 36: undefined symbol: F_FLOCKW "../libc/sys/common/flock.c", line 49: undefined symbol: F_FLOCK
At the time of the errors, it was building in usr/src/lib/libbc/sparc . This is a binary compatibility library needed for old sun4 binaries to run correctly on newer SPARC hardware. It includes a private version of sys/fcntl.h that includes sys/fcntlcom.h, also a private header. The flock.c file is shared between this library and the normal libc. Changes to flock.c made between October and January caused these two symbols to be undefined for the binary compatibility library build only.
The solution is to add these two lines to usr/src/lib/libbc/inc/include/sys/fcntlcom.h:
#define F_FLOCKW F_SETLKW #define F_FLOCK F_SETLK
This change reverses the source change in flock.c that was made between October and January, but only for the binary compatibility library build.
With this change, the build in usr/src/lib/libbc/sparc completes with no errors. The binary compatibility library is built correctly. The pics/flock.o files from October and January are identical in size. Note that sun4 executables are 32-bit only.
Updated by Gary Mills over 5 years ago
These are the changes to flock.c that I mentioned:
- int cmd = F_SETLKW; + int cmd = F_FLOCKW; ... - if (operation & LOCK_NB) - cmd = F_SETLK; - return(bc_fcntl(fd, cmd, &fl)); + if (operation & LOCK_NB) + cmd = F_FLOCK; + return (bc_fcntl(fd, cmd, &fl));
Updated by Electric Monk about 5 years ago
- Status changed from Feedback to Closed
- % Done changed from 80 to 100
commit f3b6506e5de00944c5a877f02a83b5e850f37ef5 Author: Gary Mills <email@example.com> Date: 2016-02-05T20:22:07.000Z 6564 F_FLOCKW and F_FLOCK are undefined symbols in SPARC build Reviewed by: Igor Kozhukhov <firstname.lastname@example.org> Reviewed by: Gordon Ross <email@example.com> Approved by: Robert Mustacchi <firstname.lastname@example.org>