C with gold doesn't compile in mounted volumes

I don’t know if this is wrong per se really. As far as I can tell, this is caused by HFS+/Mac not supporting fallocate.

Expected behavior

The gold linker should work in both mounted volumes and internal filesystems.

Actual behavior

The gold linker does not work in mounted volumes.


pinata diagnose -u

OS X: version 10.11.3 (build: 15D21)
Docker.app: version v1.11.0-beta7
Running diagnostic tests:
[OK]      docker-cli
[OK]      Moby booted
[OK]      driver.amd64-linux
[OK]      vmnetd
[OK]      osxfs
[OK]      db
[OK]      slirp
[OK]      menubar
[OK]      environment
[OK]      Docker
[OK]      VT-x
Docker logs are being collected into /tmp/20160420-203354.tar.gz
Most specific failure is: No error was detected
Your unique id is: B615558F-E16F-4E55-A203-7AC918025C32
Please quote this in all correspondence.
  • OS X 10.11.3
  • Using docker image fpco/stack-build
  • strace log of the linker step attached

Steps to reproduce the behavior

  1. Mount a local volume from the machine to Docker.
  2. Have a test.c file in the volume
  3. Compile with gcc -fuse-ld=gold test.c -o testGold.o (This fails)
  4. Compile with gcc -fuse-ld=bfd test.c -o testBfd.o (This works)
  5. Compile with gcc -fuse-ld=gold test.c -o /testGold2.o (This works)


Passing --no-posix-fallocate to gold, or using bfd.

strace.log (17.1 KB)

Hi Diego,

This is a very interesting issue and use case. We do not currentl support fallocate on bind mounted OS X volumes but fallocate emulation is on our roadmap and so far we only were aware of a MySQL use case. I’m sure even more uses exist but your issue is very helpful. Thank you for your report.

Best regards,