Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
L ldpl
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 8
    • Issues 8
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Lartu
  • ldpl
  • Merge requests
  • !18

Merged
Created Mar 13, 2019 by Lartu@lartu🐕Maintainer

clang doesn't really support -static on darwin

  • Overview 6
  • Commits 1
  • Changes 1

Created by: dvkt

On macOS 10.14.1:

$ make
awk -f lib-to-string.awk ldpl_lib.cpp > ldpl_included_lib.cpp
c++ -g -c -Wall -std=gnu++11 -fpermissive -DVERSION='"2.0.7"'   -DSTANDARD=19         -DCOMPILEDATE='"Tue Mar 12 22:23:30 PDT 2019"' ldpl.cpp
c++ -g ldpl.o -o ldpl -static-libgcc -static-libstdc++ 
clang: error: unsupported option '-static-libgcc'
make: *** [all] Error 1

clang has a -static option, but using it fails with ld: library not found for -lcrt0.o.

From developer.apple.com.

Apple does not support statically linked binaries on Mac OS X. A statically linked binary assumes binary compatibility at the kernel system call interface, and we do not make any guarantees on that front. Rather, we strive to ensure binary compatibility in each dynamically linked system library and framework.

I removed the -static flags and built a binary that works on both my laptop and another mac. Not sure if there's a better flag or way to do it.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: github/fork/dvkt/no-darwin-static