Skip to content
  • Marius Gerbershagen's avatar
    826cc929
    cmp: introduce new variables for linker flags · 826cc929
    Marius Gerbershagen authored
    Split up the options into additional flags for the linker and
    additional libraries.
    
    Quoting from issue #636:
    
    > Here's an example, attempting to link one object file named
      example.o into an executable named example. Libcrypto here is
      superfluous and should be removed by --as-needed:
    
    ```
    LDFLAGS="-Wl,--as-needed"
    LIBS="-lcrypto"
    gcc ${LDFLAGS} ${LIBS} example.o -o example # doesn't link libcrypto!
    gcc example.o ${LDFLAGS} ${LIBS} -o example # doesn't honor --as-needed!
    gcc ${LDFLAGS} example.o ${LIBS} -o example # works great!
    ```
    
    > In short, the placement of your -l<foo> flags differs from that of
      all the other linker flags. Since ECL is only providing one big
      variable ld-flags for all of the linker flags, there's no correct
      way to pass in options like --as-needed and -l<foo> at the same
      time.
    
    Fixes #636.
    826cc929
    cmp: introduce new variables for linker flags
    Marius Gerbershagen authored
    Split up the options into additional flags for the linker and
    additional libraries.
    
    Quoting from issue #636:
    
    > Here's an example, attempting to link one object file named
      example.o into an executable named example. Libcrypto here is
      superfluous and should be removed by --as-needed:
    
    ```
    LDFLAGS="-Wl,--as-needed"
    LIBS="-lcrypto"
    gcc ${LDFLAGS} ${LIBS} example.o -o example # doesn't link libcrypto!
    gcc example.o ${LDFLAGS} ${LIBS} -o example # doesn't honor --as-needed!
    gcc ${LDFLAGS} example.o ${LIBS} -o example # works great!
    ```
    
    > In short, the placement of your -l<foo> flags differs from that of
      all the other linker flags. Since ECL is only providing one big
      variable ld-flags for all of the linker flags, there's no correct
      way to pass in options like --as-needed and -l<foo> at the same
      time.
    
    Fixes #636.
To find the state of this project's repository at the time of any of these versions, check out the tags.
Loading