Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-fPIC error #2

Open
OguzhanCaglar opened this issue Oct 7, 2022 · 2 comments
Open

-fPIC error #2

OguzhanCaglar opened this issue Oct 7, 2022 · 2 comments

Comments

@OguzhanCaglar
Copy link

How can i fix it?

**stdplus$ ninja -C builddir install
ninja: Entering directory builddir' [1/11] Linking target src/libstdplus.so.0.1 FAILED: src/libstdplus.so.0.1 c++ -o src/libstdplus.so.0.1 src/libstdplus.so.0.1.p/exception.cpp.o src/libstdplus.so.0.1.p/signal.cpp.o src/libstdplus.so.0.1.p/zstring.cpp.o src/libstdplus.so.0.1.p/zstring_view.cpp.o src/libstdplus.so.0.1.p/fd_atomic.cpp.o src/libstdplus.so.0.1.p/fd_create.cpp.o src/libstdplus.so.0.1.p/fd_dupable.cpp.o src/libstdplus.so.0.1.p/fd_fmt.cpp.o src/libstdplus.so.0.1.p/fd_impl.cpp.o src/libstdplus.so.0.1.p/fd_line.cpp.o src/libstdplus.so.0.1.p/fd_managed.cpp.o src/libstdplus.so.0.1.p/fd_mmap.cpp.o src/libstdplus.so.0.1.p/fd_ops.cpp.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libstdplus.so.0 /usr/local/lib/libfmt.a -Wl,--end-group /usr/bin/ld: /usr/local/lib/libfmt.a(format.cc.o): warning: relocation against stdout@@GLIBC_2.2.5' in read-only section .text' /usr/bin/ld: /usr/local/lib/libfmt.a(format.cc.o): relocation R_X86_64_PC32 against symbol stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
[2/11] Linking target subprojects/googletest/libgtest.so
ninja: build stopped: subcommand failed.
**

@wak-google
Copy link
Contributor

Disable shared linking if you are using a static only libc.

@williamspatrick
Copy link
Member

Disable shared linking if you are using a static only libc.

I think there is an option missing to the fmt subproject build. By default does fmt generate a static library? It looks like that is what is attempting to be linked against here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants