Project

General

Profile

Bug #6564

F_FLOCKW and F_FLOCK are undefined symbols in SPARC build

Added by Gary Mills over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2016-01-18
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

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.

History

#1

Updated by Gary Mills over 4 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));
#2

Updated by Electric Monk over 4 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 80 to 100

git commit f3b6506e5de00944c5a877f02a83b5e850f37ef5

commit  f3b6506e5de00944c5a877f02a83b5e850f37ef5
Author: Gary Mills <gary_mills@fastmail.fm>
Date:   2016-02-05T20:22:07.000Z

    6564 F_FLOCKW and F_FLOCK are undefined symbols in SPARC build
    Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
    Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF