lastpass / lastpass-cli

LastPass command line interface tool
GNU General Public License v2.0
2.85k stars 292 forks source link

Mark global variable as extern #535

Closed eclipseo closed 11 months ago

eclipseo commented 4 years ago

GCC now defaults to -fno-common. As a result, global variable accesses are more efficient on various targets. In C, global variables with multiple tentative definitions now result in linker errors.

Fix #532

Signed-off-by: Robert-André Mauchin zebob.m@gmail.com

alealv commented 4 years ago

Thanks! work's great

FrederikP commented 3 years ago

Just ran into this using ubuntu/pop_os 20.10 Are you going to merge this at some point?

mvanveen commented 3 years ago

confirmed this fixes the issues I experienced on debian:bullseye-slim.

example Dockerfile:

FROM debian:bullseye-slim
RUN apt-get update
RUN apt-get --no-install-recommends -yqq install \
  bash-completion \
  build-essential \
  cmake \
  libcurl4  \
  libcurl4-openssl-dev  \
  libssl-dev  \
  libxml2 \
  libxml2-dev  \
  libssl1.1 \
  pkg-config \
  ca-certificates \
  xclip \
  git
WORKDIR /code
RUN git clone https://github.com/eclipseo/lastpass-cli.git
WORKDIR /code/lastpass-cli
RUN git checkout mark_global_var_as_extern
RUN make
RUN make install

CMD lpass

using the current master branch will reliably produce #532 whereas checking out @eclipseo's mark_global_var_as_extern branch fixes the issue and results in a successful compilation

mvanveen commented 3 years ago

thank you @eclipseo !

mattalxndr commented 3 years ago

What is the timeline for merging this in?

lukebakken commented 11 months ago

@eclipseo thank you for this patch. It allows me to compile this project on Ubuntu 22.04.

TiborKLP commented 11 months ago

Fix applied in d23846481066ea0a617a7338a3529e78b2eb517a