[oi-dev] strange compiler error

2022-11-04 Thread Friedrich Kink via oi-dev

Hi all,

I try to compile the newest asterisk version, but I get the following 
linker error:


/usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r -Wl,-b 
binary -o res_geolocation/pidf_lo_test.o res_geolocation/pidf_lo_test.xml

ld: fatal: file binary: open failed: No such file or directory

/usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r 
-Wl,--format=binary -o res_geolocation/pidf_lo_test.o 
res_geolocation/pidf_lo_test.xml

ld: fatal: unrecognized option '--format=binary'
ld: fatal: use the -z help option for usage information

according to the man page (man ld) both variants are allowed, so I'd 
assume that it works (s. below)


..


   -b input-format
   --format=input-format
   ld may be configured to support more than one kind of object 
file.

   If your ld is configured this way, you can use the -b option to
   specify the binary format for input object files that follow 
this
   option on the command line.  Even when ld is configured to 
support
   alternative object formats, you don't usually need to 
specify this,
   as ld should be configured to expect as a default input 
format the
   most usual format on each machine.  input-format is a text 
string,

   the name of a particular format supported by the BFD libraries.
   (You can list the available binary formats with objdump -i.)

   You may want to use this option if you are linking files with an
   unusual binary format.  You can also use -b to switch formats
   explicitly (when linking object files of different formats), by
   including -b input-format before each group of object files in a
   particular format.

   The default format is taken from the environment variable
   "GNUTARGET".

   You can also define the input format from a script, using the
   command "TARGET";

Any idea what else could be wrong?

kind regards,

  Fritz


___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev


Re: [oi-dev] strange compiler error

2022-11-04 Thread Toomas Soome via oi-dev
You pass -b ( to linker) but not “binary”.

Sent from my iPhone

> On 4. Nov 2022, at 22:14, Friedrich Kink via oi-dev  
> wrote:
> 
> Hi all,
> 
> I try to compile the newest asterisk version, but I get the following linker 
> error:
> 
> /usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r -Wl,-b binary 
> -o res_geolocation/pidf_lo_test.o res_geolocation/pidf_lo_test.xml
> ld: fatal: file binary: open failed: No such file or directory
> 
> /usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r 
> -Wl,--format=binary -o res_geolocation/pidf_lo_test.o 
> res_geolocation/pidf_lo_test.xml
> ld: fatal: unrecognized option '--format=binary'
> ld: fatal: use the -z help option for usage information
> 
> according to the man page (man ld) both variants are allowed, so I'd assume 
> that it works (s. below)
> 
> ..
> 
> 
>-b input-format
>--format=input-format
>ld may be configured to support more than one kind of object file.
>If your ld is configured this way, you can use the -b option to
>specify the binary format for input object files that follow this
>option on the command line.  Even when ld is configured to support
>alternative object formats, you don't usually need to specify this,
>as ld should be configured to expect as a default input format the
>most usual format on each machine.  input-format is a text string,
>the name of a particular format supported by the BFD libraries.
>(You can list the available binary formats with objdump -i.)
> 
>You may want to use this option if you are linking files with an
>unusual binary format.  You can also use -b to switch formats
>explicitly (when linking object files of different formats), by
>including -b input-format before each group of object files in a
>particular format.
> 
>The default format is taken from the environment variable
>"GNUTARGET".
> 
>You can also define the input format from a script, using the
>command "TARGET";
> 
> Any idea what else could be wrong?
> 
> kind regards,
> 
>   Fritz
> 
> 
> ___
> oi-dev mailing list
> oi-dev@openindiana.org
> https://openindiana.org/mailman/listinfo/oi-dev

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev


Re: [oi-dev] strange compiler error

2022-11-04 Thread Friedrich Kink via oi-dev
hmm but I understand the manpage that -b is the linker switch and binary 
the input format key word, which is valid see below. And even I use it 
like '-Wl,-b,binary` it gives the same error.


objdump -i
BFD header file version (GNU Binutils) 2.39
elf32-i386-sol2
 (header little endian, data little endian)
  i386
elf32-iamcu
 (header little endian, data little endian)
  iamcu
coff-i386
 (header little endian, data little endian)
  i386
pei-i386
 (header little endian, data little endian)
  i386
elf64-x86-64-sol2
 (header little endian, data little endian)
  i386
pe-x86-64
 (header little endian, data little endian)
  i386
pei-x86-64
 (header little endian, data little endian)
  i386
elf64-little
 (header little endian, data little endian)
  i386
  iamcu
elf64-big
 (header big endian, data big endian)
  i386
  iamcu
elf32-little
 (header little endian, data little endian)
  i386
  iamcu
elf32-big
 (header big endian, data big endian)
  i386
  iamcu
srec
 (header endianness unknown, data endianness unknown)
  i386
  iamcu
symbolsrec
 (header endianness unknown, data endianness unknown)
  i386
  iamcu
verilog
 (header endianness unknown, data endianness unknown)
  i386
  iamcu
tekhex
 (header endianness unknown, data endianness unknown)
  i386
  iamcu
*binary*
 (header endianness unknown, data endianness unknown)
  i386
  iamcu
ihex
 (header endianness unknown, data endianness unknown)
  i386
  iamcu
plugin
 (header little endian, data little endian)

 elf32-i386-sol2 elf32-iamcu coff-i386 pei-i386 elf64-x86-64-sol2
    i386 elf32-i386-sol2 --- coff-i386 pei-i386 elf64-x86-64-sol2
   iamcu --- elf32-iamcu -  -

 pe-x86-64 pei-x86-64 elf64-little elf64-big elf32-little elf32-big
    i386 pe-x86-64 pei-x86-64 elf64-little elf64-big elf32-little elf32-big
   iamcu - -- elf64-little elf64-big elf32-little elf32-big

 srec symbolsrec verilog tekhex *binary *ihex plugin
    i386 srec symbolsrec verilog tekhex *binary *ihex --
   iamcu srec symbolsrec verilog tekhex *binary *ihex --

Am 04.11.2022 um 21:34 schrieb Toomas Soome:

You pass -b ( to linker) but not “binary”.

Sent from my iPhone


On 4. Nov 2022, at 22:14, Friedrich Kink via oi-dev  
wrote:

Hi all,

I try to compile the newest asterisk version, but I get the following linker 
error:

/usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r -Wl,-b binary 
-o res_geolocation/pidf_lo_test.o res_geolocation/pidf_lo_test.xml
ld: fatal: file binary: open failed: No such file or directory

/usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r 
-Wl,--format=binary -o res_geolocation/pidf_lo_test.o 
res_geolocation/pidf_lo_test.xml
ld: fatal: unrecognized option '--format=binary'
ld: fatal: use the -z help option for usage information

according to the man page (man ld) both variants are allowed, so I'd assume 
that it works (s. below)

..


-b input-format
--format=input-format
ld may be configured to support more than one kind of object file.
If your ld is configured this way, you can use the -b option to
specify the binary format for input object files that follow this
option on the command line.  Even when ld is configured to support
alternative object formats, you don't usually need to specify this,
as ld should be configured to expect as a default input format the
most usual format on each machine.  input-format is a text string,
the name of a particular format supported by the BFD libraries.
(You can list the available binary formats with objdump -i.)

You may want to use this option if you are linking files with an
unusual binary format.  You can also use -b to switch formats
explicitly (when linking object files of different formats), by
including -b input-format before each group of object files in a
particular format.

The default format is taken from the environment variable
"GNUTARGET".

You can also define the input format from a script, using the
command "TARGET";

Any idea what else could be wrong?

kind regards,

   Fritz


___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev


Re: [oi-dev] strange compiler error

2022-11-04 Thread Peter Tribble
Hi,

You're passing an option that's only valid for gnu ld, but the ld in use
is the illumos one.

Presumably you're picking up the gnu ld manual page because of the way
your PATH is set, but gcc is explicitly configured to use a particular ld
(and as - see the output of 'gcc -v' for how it's configured) rather than
picking
it out of the PATH.


On Fri, Nov 4, 2022 at 8:14 PM Friedrich Kink via oi-dev <
oi-dev@openindiana.org> wrote:

> Hi all,
>
> I try to compile the newest asterisk version, but I get the following
> linker error:
>
> /usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r -Wl,-b
> binary -o res_geolocation/pidf_lo_test.o res_geolocation/pidf_lo_test.xml
> ld: fatal: file binary: open failed: No such file or directory
>
> /usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r
> -Wl,--format=binary -o res_geolocation/pidf_lo_test.o
> res_geolocation/pidf_lo_test.xml
> ld: fatal: unrecognized option '--format=binary'
> ld: fatal: use the -z help option for usage information
>
> according to the man page (man ld) both variants are allowed, so I'd
> assume that it works (s. below)
>
> ..
>
>
> -b input-format
> --format=input-format
> ld may be configured to support more than one kind of object
> file.
> If your ld is configured this way, you can use the -b option to
> specify the binary format for input object files that follow
> this
> option on the command line.  Even when ld is configured to
> support
> alternative object formats, you don't usually need to
> specify this,
> as ld should be configured to expect as a default input
> format the
> most usual format on each machine.  input-format is a text
> string,
> the name of a particular format supported by the BFD libraries.
> (You can list the available binary formats with objdump -i.)
>
> You may want to use this option if you are linking files with
> an
> unusual binary format.  You can also use -b to switch formats
> explicitly (when linking object files of different formats), by
> including -b input-format before each group of object files in
> a
> particular format.
>
> The default format is taken from the environment variable
> "GNUTARGET".
>
> You can also define the input format from a script, using the
> command "TARGET";
>
> Any idea what else could be wrong?
>
> kind regards,
>
>Fritz
>
>
> ___
> oi-dev mailing list
> oi-dev@openindiana.org
> https://openindiana.org/mailman/listinfo/oi-dev
>


-- 
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev


Re: [oi-dev] strange compiler error

2022-11-04 Thread Toomas Soome via oi-dev


> On 4. Nov 2022, at 22:47, Friedrich Kink  wrote:
> 
> hmm but I understand the manpage that -b is the linker switch and binary the 
> input format key word, which is valid see below. And even I use it like 
> '-Wl,-b,binary` it gives the same error. 
> 

how about -Wl,-b -Wl,binary ?

rgds,
toomas

> objdump -i
> BFD header file version (GNU Binutils) 2.39
> elf32-i386-sol2
>  (header little endian, data little endian)
>   i386
> elf32-iamcu
>  (header little endian, data little endian)
>   iamcu
> coff-i386
>  (header little endian, data little endian)
>   i386
> pei-i386
>  (header little endian, data little endian)
>   i386
> elf64-x86-64-sol2
>  (header little endian, data little endian)
>   i386
> pe-x86-64
>  (header little endian, data little endian)
>   i386
> pei-x86-64
>  (header little endian, data little endian)
>   i386
> elf64-little
>  (header little endian, data little endian)
>   i386
>   iamcu
> elf64-big
>  (header big endian, data big endian)
>   i386
>   iamcu
> elf32-little
>  (header little endian, data little endian)
>   i386
>   iamcu
> elf32-big
>  (header big endian, data big endian)
>   i386
>   iamcu
> srec
>  (header endianness unknown, data endianness unknown)
>   i386
>   iamcu
> symbolsrec
>  (header endianness unknown, data endianness unknown)
>   i386
>   iamcu
> verilog
>  (header endianness unknown, data endianness unknown)
>   i386
>   iamcu
> tekhex
>  (header endianness unknown, data endianness unknown)
>   i386
>   iamcu
> binary
>  (header endianness unknown, data endianness unknown)
>   i386
>   iamcu
> ihex
>  (header endianness unknown, data endianness unknown)
>   i386
>   iamcu
> plugin
>  (header little endian, data little endian)
> 
>  elf32-i386-sol2 elf32-iamcu coff-i386 pei-i386 elf64-x86-64-sol2
> i386 elf32-i386-sol2 --- coff-i386 pei-i386 elf64-x86-64-sol2
>iamcu --- elf32-iamcu -  -
> 
>  pe-x86-64 pei-x86-64 elf64-little elf64-big elf32-little elf32-big
> i386 pe-x86-64 pei-x86-64 elf64-little elf64-big elf32-little elf32-big
>iamcu - -- elf64-little elf64-big elf32-little elf32-big
> 
>  srec symbolsrec verilog tekhex binary ihex plugin
> i386 srec symbolsrec verilog tekhex binary ihex --
>iamcu srec symbolsrec verilog tekhex binary ihex --
> 
> 
> Am 04.11.2022 um 21:34 schrieb Toomas Soome:
>> You pass -b ( to linker) but not “binary”.
>> 
>> Sent from my iPhone
>> 
>>> On 4. Nov 2022, at 22:14, Friedrich Kink via oi-dev 
>>>   wrote:
>>> 
>>> Hi all,
>>> 
>>> I try to compile the newest asterisk version, but I get the following 
>>> linker error:
>>> 
>>> /usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r -Wl,-b 
>>> binary -o res_geolocation/pidf_lo_test.o res_geolocation/pidf_lo_test.xml
>>> ld: fatal: file binary: open failed: No such file or directory
>>> 
>>> /usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r 
>>> -Wl,--format=binary -o res_geolocation/pidf_lo_test.o 
>>> res_geolocation/pidf_lo_test.xml
>>> ld: fatal: unrecognized option '--format=binary'
>>> ld: fatal: use the -z help option for usage information
>>> 
>>> according to the man page (man ld) both variants are allowed, so I'd assume 
>>> that it works (s. below)
>>> 
>>> ..
>>> 
>>> 
>>>-b input-format
>>>--format=input-format
>>>ld may be configured to support more than one kind of object 
>>> file.
>>>If your ld is configured this way, you can use the -b option to
>>>specify the binary format for input object files that follow this
>>>option on the command line.  Even when ld is configured to 
>>> support
>>>alternative object formats, you don't usually need to specify 
>>> this,
>>>as ld should be configured to expect as a default input format 
>>> the
>>>most usual format on each machine.  input-format is a text 
>>> string,
>>>the name of a particular format supported by the BFD libraries.
>>>(You can list the available binary formats with objdump -i.)
>>> 
>>>You may want to use this option if you are linking files with an
>>>unusual binary format.  You can also use -b to switch formats
>>>explicitly (when linking object files of different formats), by
>>>including -b input-format before each group of object files in a
>>>particular format.
>>> 
>>>The default format is taken from the environment variable
>>>"GNUTARGET".
>>> 
>>>You can also define the input format from a script, using the
>>>command "TARGET";
>>> 
>>> Any idea what else could be wrong?
>>> 
>>> kind regards,
>>> 
>>>   Fritz
>>> 
>>> 
>>> ___
>>> oi-dev mailing list
>>> oi-dev@openindiana.org 
>>> https://openindiana.o

Re: [oi-dev] strange compiler error

2022-11-04 Thread Friedrich Kink via oi-dev

Hi,

thank you very much for this explanation (also all others). Indeed I 
used the wrong man page. Reading the right man page it seems that this 
mimic is not easily transferable to Solaris/illumos. Now I need to check 
the intention and how this can be achieved in the Solaris/illumos world.


At least now I learnt something new ;-).

kind regards,

  Fritz

Am 04.11.2022 um 21:56 schrieb Peter Tribble:

Hi,

You're passing an option that's only valid for gnu ld, but the ld in use
is the illumos one.

Presumably you're picking up the gnu ld manual page because of the way
your PATH is set, but gcc is explicitly configured to use a particular ld
(and as - see the output of 'gcc -v' for how it's configured) rather 
than picking

it out of the PATH.


On Fri, Nov 4, 2022 at 8:14 PM Friedrich Kink via oi-dev 
 wrote:


Hi all,

I try to compile the newest asterisk version, but I get the following
linker error:

/usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r
-Wl,-b
binary -o res_geolocation/pidf_lo_test.o
res_geolocation/pidf_lo_test.xml
ld: fatal: file binary: open failed: No such file or directory

/usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r
-Wl,--format=binary -o res_geolocation/pidf_lo_test.o
res_geolocation/pidf_lo_test.xml
ld: fatal: unrecognized option '--format=binary'
ld: fatal: use the -z help option for usage information

according to the man page (man ld) both variants are allowed, so I'd
assume that it works (s. below)

..


    -b input-format
    --format=input-format
    ld may be configured to support more than one kind of
object
file.
    If your ld is configured this way, you can use the -b
option to
    specify the binary format for input object files that
follow
this
    option on the command line.  Even when ld is
configured to
support
    alternative object formats, you don't usually need to
specify this,
    as ld should be configured to expect as a default input
format the
    most usual format on each machine. input-format is a text
string,
    the name of a particular format supported by the BFD
libraries.
    (You can list the available binary formats with
objdump -i.)

    You may want to use this option if you are linking
files with an
    unusual binary format.  You can also use -b to switch
formats
    explicitly (when linking object files of different
formats), by
    including -b input-format before each group of object
files in a
    particular format.

    The default format is taken from the environment variable
    "GNUTARGET".

    You can also define the input format from a script,
using the
    command "TARGET";

Any idea what else could be wrong?

kind regards,

   Fritz


___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev



--
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev