Giter VIP home page Giter VIP logo

Comments (7)

12101111 avatar 12101111 commented on September 1, 2024

The build issue should fixed in ab03d6a and c4d84e4
As to CFLAGS, passing CFLAGS to bmake will cause a build error:

bmake -j13 CC=clang LD=x86_64-gentoo-linux-musl-ld 'CFLAGS=-march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin' 'LDFLAGS=-fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -flto=thin -Wl,-O3 -Wl,--gc-sections -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -stdlib=libc++' 
--- all ---
===> common
/tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/common/native-elf-format > native-elf-format.h || rm native-elf-format.h
===> libelf
--- elf.po ---
--- elf_begin.po ---
--- elf_cntl.po ---
--- elf_end.po ---
--- elf_errmsg.po ---
--- elf_errno.po ---
--- elf_data.po ---
--- elf_fill.po ---
--- elf_flag.po ---
--- elf_getarhdr.po ---
--- elf_getarsym.po ---
--- elf_getbase.po ---
--- elf_getident.po ---
--- elf.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf.c -o elf.po.o
--- elf_begin.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf_begin.c -o elf_begin.po.o
--- elf_cntl.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf_cntl.c -o elf_cntl.po.o
--- elf_end.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf_end.c -o elf_end.po.o
--- elf_errmsg.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf_errmsg.c -o elf_errmsg.po.o
--- elf_errno.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf_errno.c -o elf_errno.po.o
--- elf_data.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf_data.c -o elf_data.po.o
--- elf_fill.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf_fill.c -o elf_fill.po.o
--- elf_flag.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf_flag.c -o elf_flag.po.o
--- elf_getarhdr.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf_getarhdr.c -o elf_getarhdr.po.o
--- elf_getarsym.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf_getarsym.c -o elf_getarsym.po.o
--- elf_getbase.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf_getbase.c -o elf_getbase.po.o
--- elf_getident.po ---
clang -march=skylake -mtune=skylake -O3 -pipe -falign-functions=32 -ffunction-sections -fdata-sections -flto=thin      -c -pg -DGPROF -DPROF elf_getident.c -o elf_getident.po.o
--- elf.po ---
In file included from elf.c:29:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
*** [elf.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
--- elf_errmsg.po ---
In file included from elf_errmsg.c:31:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
--- elf_fill.po ---
In file included from elf_fill.c:29:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
--- elf_errmsg.po ---
*** [elf_errmsg.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
--- elf_fill.po ---
1 error generated.
*** [elf_fill.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
--- elf_end.po ---
In file included from elf_end.c:31:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
*** [elf_end.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
--- elf_errno.po ---
In file included from elf_errno.c:29:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
--- elf_begin.po ---
In file included from elf_begin.c:29:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
--- elf_errno.po ---
1 error generated.
--- elf_begin.po ---
1 error generated.
--- elf_errno.po ---
*** [elf_errno.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
--- elf_flag.po ---
In file included from elf_flag.c:29:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
--- elf_begin.po ---
*** [elf_begin.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
--- elf_getident.po ---
In file included from elf_getident.c:31:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
--- elf_flag.po ---
1 error generated.
--- elf_getident.po ---
*** [elf_getident.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
--- elf_flag.po ---
*** [elf_flag.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
--- elf_getarsym.po ---
In file included from elf_getarsym.c:29:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
*** [elf_getarsym.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
--- elf_getbase.po ---
In file included from elf_getbase.c:29:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
*** [elf_getbase.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
--- elf_data.po ---
In file included from elf_data.c:33:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
--- elf_cntl.po ---
In file included from elf_cntl.c:29:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
--- elf_getarhdr.po ---
In file included from elf_getarhdr.c:29:
In file included from ./_libelf.h:34:
./_libelf_config.h:167:10: fatal error: 'native-elf-format.h' file not found
#include "native-elf-format.h"
         ^~~~~~~~~~~~~~~~~~~~~
--- elf_data.po ---
1 error generated.
--- elf_cntl.po ---
1 error generated.
--- elf_getarhdr.po ---
1 error generated.
--- elf_data.po ---
*** [elf_data.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
--- elf_getarhdr.po ---
*** [elf_getarhdr.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
--- elf_cntl.po ---
*** [elf_cntl.po] Error code 1

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
13 errors

bmake[1]: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/libelf
*** [all] Error code 1

bmake: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1
1 error

bmake: stopped in /tmp/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1

It seems CFLAGS defined in makefile is overridden, and I'm not sure what's the correct way to provide CFLAGS to bmake

from overlay.

OlehVinichenko avatar OlehVinichenko commented on September 1, 2024

compilation goes further now, but fails with duplicate symbols:

cc -pipe -g -I. -I/var/src/build/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/ld -I. -I/var/src/build/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/ld -I../common -I../libdwarf -I../libelf -I../libelftc -MD -MF ld_script_lexer.d -MT ld_script_lexer.o -c ld_script_lexer.c
cc -pipe -g -I. -I/var/src/build/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/ld -I. -I/var/src/build/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/ld -I../common -I../libdwarf -I../libelf -I../libelftc -MD -MF ld_script_parser.d -MT ld_script_parser.o -c ld_script_parser.c
cc -pipe -L../libdwarf -L../libelf -L../libelftc -o ld amd64.o amd64_script.o i386.o i386_script.o ld_arch.o ld_dynamic.o ld_ehframe.o ld_error.o ld_exp.o ld_file.o ld_hash.o ld_input.o ld_layout.o ld_main.o ld_options.o ld_output.o ld_path.o ld_reloc.o ld_script.o ld_strtab.o ld_symbols.o ld_symver.o mips.o littlemips_script.o bigmips_script.o ld_script_lexer.o ld_script_parser.o -lelftc -ldwarf -lelf
ld.lld: error: duplicate symbol: amd64_script

defined at amd64.h:29 (./amd64.h:29)
amd64.o:(amd64_script)
defined at amd64_script.c:1
amd64_script.o:(.data+0x0)

ld.lld: error: duplicate symbol: i386_script

defined at i386.h:29 (./i386.h:29)
i386.o:(i386_script)
defined at i386_script.c:1
i386_script.o:(.data+0x0)

ld.lld: error: duplicate symbol: amd64_script

defined at amd64.h:29 (./amd64.h:29)
amd64.o:(amd64_script)
defined at amd64.h:29 (./amd64.h:29)
ld_arch.o:(.bss+0x8)

ld.lld: error: duplicate symbol: i386_script

defined at i386.h:29 (./i386.h:29)
i386.o:(i386_script)
defined at i386.h:29 (./i386.h:29)
ld_arch.o:(.bss+0x0)

ld.lld: error: duplicate symbol: bigmips_script

defined at mips.h:27 (./mips.h:27)
ld_arch.o:(bigmips_script)
defined at mips.h:27 (./mips.h:27)
mips.o:(.bss+0x8)

ld.lld: error: duplicate symbol: littlemips_script

defined at mips.h:26 (./mips.h:26)
ld_arch.o:(littlemips_script)
defined at mips.h:26 (./mips.h:26)
mips.o:(.bss+0x0)

ld.lld: error: duplicate symbol: littlemips_script

defined at mips.h:26 (./mips.h:26)
ld_arch.o:(littlemips_script)
defined at littlemips_script.c:1
littlemips_script.o:(.data+0x0)

ld.lld: error: duplicate symbol: bigmips_script

defined at mips.h:27 (./mips.h:27)
ld_arch.o:(bigmips_script)
defined at bigmips_script.c:1
bigmips_script.o:(.data+0x0)
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
bmake[1]: stopped in /var/src/build/portage/dev-libs/elftoolchain-0.7.1/work/elftoolchain-0.7.1/ld
*** Error code 1

from overlay.

12101111 avatar 12101111 commented on September 1, 2024

This should be fixed by https://github.com/12101111/overlay/blob/master/dev-libs/elftoolchain/files/fix-fno-common.patch

from overlay.

OlehVinichenko avatar OlehVinichenko commented on September 1, 2024

yes, indeed, i missed this.

from overlay.

OlehVinichenko avatar OlehVinichenko commented on September 1, 2024

installed fine now. speaking of elftoolchain, how do you replace binutils with it? do you, then, remove binutils completely?

from overlay.

12101111 avatar 12101111 commented on September 1, 2024

I use binutils from llvm ,expect gas.

AR="llvm-ar"
NM="llvm-nm"
OBJCOPY="llvm-objcopy"
RANLIB="llvm-ranlib"
SIZE="llvm-size"
STRIP="llvm-strip"

from overlay.

12101111 avatar 12101111 commented on September 1, 2024

sys-devel/elftoolchain has been in main tree, and elfutils got clang support recently.

from overlay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.