Skip to content

Fails to build with tcc(Tiny C Compiler) #6173

Description

@stalbordboat

I wrote this build task for the tcc toolchain. It's just a modified gcc toolchain:

MRuby::Toolchain.new(:tcc) do |conf, params|
  default_command = 'tcc'
  compiler_flags = %w(-g -O3 -Wall -Wundef)
  c_mandatory_flags = %w(-std=gnu99)
  compile_opt = '%{flags} -o "%{outfile}" "%{infile}"'

  conf.linker do |linker|
    linker.command = default_command
    linker.flags = [ENV['LDFLAGS'] || %w()]
    linker.libraries = %w(m)
    linker.library_paths = []
    linker.option_library = '-l%s'
    linker.option_library_path = '-L%s'
    linker.link_options = '%{flags} -o "%{outfile}" %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}'
  end
end

When it reaches the point of building mrbc(linking it with libmruby_core.a) it fails and give me this error:

LD    build/host/mrbc/bin/mrbc 
tcc: error: undefined symbol 'etext'
tcc: error: undefined symbol 'edata'

any idea what's going on here? Thank you in advance for any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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