ld: unrecognized option '-Wl,-O1'

2.3k Views Asked by At

Written a new recipe for libmoose module of perl and found the following error, Can anyone please help to fix it.

| x86_64-poky-linux-ld: unrecognized option '-Wl,-O1' | x86_64-poky-linux-ld: use the --help option for usage information | Couldn't execute x86_64-poky-linux-ld --sysroot=/yocto/build/tmp/sysroots/intel HASCOMPILERBD9Y/TESTyyC p.o -o HASCOMPILERBD9Y/TESTyyCp.so -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector -shared : Inappropriate ioctl for device at Makefile.PL line 12. | This distribution requires a working compiler at Makefile.PL line 12. | WARNING: /yocto/build/tmp/work/core2-64-poky-linux/libmoose-perl/2.2014-r0/temp/run.do_configure.18534:1 $xit 25 from 'perl Makefile.PL INSTALLDIRS=vendor'

Here is my recipe:

    SUMMARY = "Moose - modern Perl object system framework"
DESCRIPTION = "Moose is an extension of the Perl 5 object system. The main goal of Moose is to make Perl 5 Object Oriented programming easier, more consistent, and less tedious. With Moose you can think more about what you want to do and less about the mechanics of OOP."

    SECTION = "libs"
    
    HOMEPAGE = "http://metapan.org/release/Moo/"
    
    LICENSE = "Artistic-1.0 | GPL-1.0+"
    LIC_FILES_CHKSUM = "file://LICENSE;md5=076f703723ade0a7205509c2b8d87fc2"
    
    
    SRC_URI = "${CPAN_MIRROR}/authors/id/E/ET/ETHER/Moose-${PV}.tar.gz"
    
    SRC_URI[md5sum] = "6d1e84977bc2a7d0e1111e16822fc250"
    SRC_URI[sha256sum] = "33c75c11143d1943be9be61bb37e134fe4b0a316fa4494a380a2e3dd416f116a"
    
    S = "${WORKDIR}/Moose-${PV}"
    
    inherit cpan
1

There are 1 best solutions below

0
On

-WL is not meant to be passed to the linker. It is meant to be processed by the compiler, gcc. Do this:

./configure LD="" <your-usual-options>

make