Portfile question for 10.6.8

raf macports at raf.org
Wed Jun 7 06:59:10 UTC 2023


On Tue, Jun 06, 2023 at 06:49:35PM -0700, Ken Cunningham <ken.cunningham.webuse at gmail.com> wrote:

> > On Jun 6, 2023, at 6:28 PM, raf via macports-users <macports-users at lists.macports.org> wrote:
> > 
> > On Wed, Jun 07, 2023 at 11:09:13AM +1000, raf via macports-users <macports-users at lists.macports.org> wrote:
> > 
> >> Yay! It worked. Many thanks. I'll fix my Makefile for the upcoming version
> >> of rawhide and create the Portfile for that.
> > 
> > I spoke too soon. The compilation worked, but when I ran the
> > program to list everything in my home directory, there were
> > many many "Bad file descriptor" errors for fstatat(). It's
> > happening for everything immediately below the current
> > directory. Any ideas?
> > 
> > cheers,
> > raf
> 
> is  -I/opt/local/include/LegacySupport making it into your CFLAGS and CXXFLAGS during the build?

It is now.

  CFLAGS='-Os -I/opt/local/include/LegacySupport -arch x86_64'
  LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -lMacportsLegacySupport -arch x86_64'

An example compilation command is:

  cc -Os -I/opt/local/include/LegacySupport -arch
  x86_64 -O3 -g -Wall -pedantic -DETCDIR=\"/etc\"
  -DRAWHIDE_NAME=\"rawhide\" -DRAWHIDE_PROG_NAME=\"rh\"
  -DRAWHIDE_VERSION=\"3.1\" -DRAWHIDE_DATE=\"20221011\"
  -DHAVE_PCRE2=1 -DHAVE_ACL=1 -DHAVE_POSIX_ACL=1
  -DHAVE_MACOS_ACL=1 -DHAVE_EA=1 -DHAVE_MACOS_EA=1
  -DHAVE_FLAGS=1 -DHAVE_MAGIC=1    -I/opt/local/include
  -c rhdir.c

And the final link command is:

  cc -Os -I/opt/local/include/LegacySupport -arch
  x86_64 -O3 -g -Wall -pedantic -DETCDIR=\"/etc\"
  -DRAWHIDE_NAME=\"rawhide\" -DRAWHIDE_PROG_NAME=\"rh\"
  -DRAWHIDE_VERSION=\"3.1\" -DRAWHIDE_DATE=\"20221011\"
  -DHAVE_PCRE2=1 -DHAVE_ACL=1 -DHAVE_POSIX_ACL=1
  -DHAVE_MACOS_ACL=1 -DHAVE_EA=1 -DHAVE_MACOS_EA=1
  -DHAVE_FLAGS=1 -DHAVE_MAGIC=1    -I/opt/local/include
  -o rh rhcmds.o rh.o rhparse.o rhdir.o rhdata.o
  rhstr.o rherr.o -L/opt/local/lib
  -Wl,-headerpad_max_install_names
  -lMacportsLegacySupport -arch x86_64 -L/opt/local/lib
  -lpcre2-8     -lmagic

And with debugging on, everything looks correct until
the error:

  openat(parent_fd=3, path=.git)
  openat: dir_fd 4
  fdopendir(dir_fd=4)
  dir entry ./.git/branches
  fstatat(parent_fd=4, path=branches)
  rh: fstatat ./.git/branches: Bad file descriptor

The "bad" file descriptor is 4 which was returned by openat.
That what's it looks like on other systems that work. Mysterious.

cheers,
raf



More information about the macports-users mailing list