Skip to content

Failure building with -s USE_FREETYPE=1 with 1.38.47 #9571

Closed

Description

@jeromelaban

When building with emcc and -s USE_FREETYPE=1, builds 1.38.46 and 1.38.47 fail with the following error:

tools.shared.Py2CalledProcessError: Command '['/usr/bin/python', '/home/jay/github/emsdk/upstream/emscripten/emcc.py', '-s', 'RELOCATABLE', '/home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/src/base/ftbdf.c', '-DFT2_BUILD_LIBRARY', '-O2', '-o', '/home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/src/base/ftbdf.c.o', '-I/home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/include', '-I/home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/truetype', '-I/home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/sfnt', '-I/home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/autofit', '-I/home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/smooth', '-I/home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/raster', '-I/home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/psaux', '-I/home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/psnames', '-I/home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/truetype', '-w']' returned non-zero exit status 1
wasm-ld: error: -r and -pie may not be used together
shared:ERROR: '/home/jay/github/emsdk/upstream/bin/wasm-ld -o /home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/src/base/ftbbox.c.o --allow-undefined --lto-O0 /tmp/emscripten_temp_y4b1jt/ftbbox_0.o -L/home/jay/github/emsdk/upstream/emscripten/system/local/lib -L/home/jay/github/emsdk/upstream/emscripten/system/lib -L/home/jay/.emscripten_cache/wasm-obj-pic --import-memory --import-table -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --no-gc-sections --export-dynamic --export __wasm_call_ctors --export __data_end --export main --export malloc --export free --export setThrew --export __errno_location -pie -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --relocatable' failed (1)
jay@0d1e56c57a18:~$ wasm-ld: error: -r and -pie may not be used together
shared:ERROR: '/home/jay/github/emsdk/upstream/bin/wasm-ld -o /home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/src/base/ftbitmap.c.o --allow-undefined --lto-O0 /tmp/emscripten_temp_shIwLh/ftbitmap_0.o -L/home/jay/github/emsdk/upstream/emscripten/system/local/lib -L/home/jay/github/emsdk/upstream/emscripten/system/lib -L/home/jay/.emscripten_cache/wasm-obj-pic --import-memory --import-table -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --no-gc-sections --export-dynamic --export __wasm_call_ctors --export __data_end --export main --export malloc --export free --export setThrew --export __errno_location -pie -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --relocatable' failed (1)
wasm-ld: error: -r and -pie may not be used together
shared:ERROR: '/home/jay/github/emsdk/upstream/bin/wasm-ld -o /home/jay/.emscripten_cache/wasm-obj-pic/ports-builds/freetype/src/autofit/autofit.c.o --allow-undefined --lto-O0 /tmp/emscripten_temp_McLHKL/autofit_0.o -L/home/jay/github/emsdk/upstream/emscripten/system/local/lib -L/home/jay/github/emsdk/upstream/emscripten/system/lib -L/home/jay/.emscripten_cache/wasm-obj-pic --import-memory --import-table -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --no-gc-sections --export-dynamic --export __wasm_call_ctors --export __data_end --export main --export malloc --export free --export setThrew --export __errno_location -pie -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --relocatable' failed (1)

The generation of the cache works on 1.38.45.

This issue seems somehow related to #9510

Activity

  1. kripken commented on Oct 3, 2019

    @kripken
    Member

    Do you have a full testcase? other.test_freetype passes on CI and locally for me. So does building a hello world program with that flag.

    (That's on latest tip-of-tree, but I don't think we landed any linking fixes since 1.38.47.)

  2. kripken commented on Oct 3, 2019

    @kripken
    Member

    cc @sbc100 as maybe that error message $ wasm-ld: error: -r and -pie may not be used together may ring a bell.

  3. jeromelaban commented on Oct 3, 2019

    @jeromelaban
    Author

    @kripken apologies for not giving enough details from the get go.

    Here's the full repro:

    EMCC_FORCE_STDLIBS=1 emcc test.c -s SIDE_MODULE=1 -s LEGALIZE_JS_FFI=0 -s USE_FREETYPE=1 -o side.wasm
    

    where test.c is an empty file, but it does not seem to be relevant, though.

  4. kripken commented on Oct 3, 2019

    @kripken
    Member

    Thanks @jeromelaban!

    I can reproduce it locally, and bisected to @sbc100 's #9444

    commit 0305b344d9a568e65ff3aea8e04a1a7af346d0c9 (HEAD)
    Author: Sam Clegg <[email protected]>
    Date:   Wed Sep 18 19:26:05 2019 -0700
    
        Perform "linking to object file" as separate phase. (#9444)
        
        This change moves the "linking to object file" logic to separate
        phase which runs after compilation, but before the real "linking"
        phase.  We can also delay library processing until after this phase
        as that is only needed for actual linking.
        
        This change is a step towards more conventional library linking
        See #8912.
    
  5. self-assigned this
    on Oct 7, 2019
  6. sbc100 commented on Oct 7, 2019

    @sbc100
    Collaborator

    Yeah, its the SIDE_MODULE=1 thing that triggers this issue I think. I'll take a look.

  7. added a commit that references this issue on Oct 8, 2019
    3166d3f
  8. added a commit that references this issue on Oct 8, 2019
    88414b2
  9. added a commit that references this issue on Dec 23, 2020
    012bff0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions