Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

/usr/bin/ld.gold: error: libsbcl.a(x86-64-assem.o): requires unsupported dynamic reloc 11; recompile with -fPIC #2

@gonzojive

Description

@gonzojive

I wasn't able to compile a hello world example. See the following error:

$ bazel build //:hello                                                                                                                                                                                                                                                   
Loading:                                                                                                                                                                                                                                                                             
Loading: 0 packages loaded                                                                                                                                                                                                                                                           
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
Analyzing: target //:hello (9 packages loaded)                                                                                                                                                                                                                                       
INFO: Analysed target //:hello (12 packages loaded).                                                                                                                                                                                                                                 
INFO: Found 1 target...                                                                                                                                                                                                                                                              
[2 / 4] BazelWorkspaceStatusAction stable-status.txt                                                                                                                                                                                                                                 
[61 / 89] Executing genrule @lisp__sbcl//:make-sbcl [for host]; 10s linux-sandbox ... (2 actions running)                                                                                                                                                                            
[61 / 89] Executing genrule @lisp__sbcl//:make-sbcl [for host]; 31s linux-sandbox ... (2 actions running)                                                                                                                                                                            
[61 / 89] Executing genrule @lisp__sbcl//:make-sbcl [for host]; 57s linux-sandbox ... (2 actions running)                                                                                                                                                                            
[61 / 89] Executing genrule @lisp__sbcl//:make-sbcl [for host]; 90s linux-sandbox ... (2 actions running)                                                                                                                                                                            
[61 / 89] Executing genrule @lisp__sbcl//:make-sbcl [for host]; 134s linux-sandbox ... (2 actions running)                                                                                                                                                                           
[61 / 89] Executing genrule @lisp__sbcl//:make-sbcl [for host]; 191s linux-sandbox ... (2 actions running)                                                                                                                                                                           
[61 / 89] Executing genrule @lisp__sbcl//:make-sbcl [for host]; 228s linux-sandbox ... (2 actions running)                                                                                                                                                                           
[61 / 89] Executing genrule @lisp__sbcl//:make-sbcl [for host]; 280s linux-sandbox ... (2 actions running)                                                                                                                                                                           
ERROR: /home/red/git/lispb/BUILD.bazel:5:1: Linking of rule '//:hello.rt' failed (Exit 1)                                                                                                                                                                                            
**/usr/bin/ld.gold: error: bazel-out/local-fastbuild/genfiles/external/lisp__sbcl/lib/sbcl/libsbcl.a(x86-64-assem.o): requires unsupported dynamic reloc 11; recompile with -fPIC**                                                                                                      
bazel-out/local-fastbuild/bin/_objs/hello.rt/hello.extern.pic.o(rodata+0x35c): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'                                                                                                                          
collect2: error: ld returned 1 exit status                                                                                                                                                                                                                                           
Target //:hello failed to build                                                                                                                                                                                                                                                      
Use --verbose_failures to see the command lines of failed build steps.                                                                                                                                                                                                               
INFO: Elapsed time: 347.880s, Critical Path: 292.50s                                                                                                                                                                                                                                 
FAILED: Build did NOT complete successfully

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions