yocto.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* How to compile binary executable files
@ 2023-03-31  4:34 MOHAMMED HASSAN
  2023-03-31  7:25 ` [yocto] " Michael Opdenacker
  0 siblings, 1 reply; 10+ messages in thread
From: MOHAMMED HASSAN @ 2023-03-31  4:34 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

Hi guys,
I am new to yocto needed your help.
I have an executable binary file that is probably compiled using the gcc
compiler. I am using yocto dunfell for my project my build_sys is
"x86_64-linux" , my target_sys is "aarch64-poky-linux".

Can you please guide me as to what I need to load this binary executable
file is my generated image file.

Thanks and Regards,
Hassan

[-- Attachment #2: Type: text/html, Size: 513 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [yocto] How to compile binary executable files
  2023-03-31  4:34 How to compile binary executable files MOHAMMED HASSAN
@ 2023-03-31  7:25 ` Michael Opdenacker
  2023-03-31  7:36   ` MOHAMMED HASSAN
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Opdenacker @ 2023-03-31  7:25 UTC (permalink / raw)
  To: MOHAMMED HASSAN, yocto

Hi Hassan

On 31.03.23 at 06:34, MOHAMMED HASSAN wrote:
> Hi guys,
> I am new to yocto needed your help.
> I have an executable binary file that is probably compiled using the 
> gcc compiler. I am using yocto dunfell for my project my build_sys is 
> "x86_64-linux" , my target_sys is "aarch64-poky-linux".
>
> Can you please guide me as to what I need to load this binary 
> executable file is my generated image file.


Is this binary statically linked? Otherwise, you have no guarantee that 
it will run on your root filesystem.

If so, you could write a recipe to integrate the binary into your root 
filesystem, as it's possible to do with pre-compiled libraries : 
https://docs.yoctoproject.org/dev-manual/common-tasks.html#working-with-pre-built-libraries. 
Caution, in this document, the new override syntax (with ":" instead of 
"_") is shown, it doesn't apply to Dunfell.

I hope this helps
Cheers
Michael.

-- 
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to compile binary executable files
  2023-03-31  7:25 ` [yocto] " Michael Opdenacker
@ 2023-03-31  7:36   ` MOHAMMED HASSAN
  2023-03-31  7:46     ` [yocto] " Michael Opdenacker
  0 siblings, 1 reply; 10+ messages in thread
From: MOHAMMED HASSAN @ 2023-03-31  7:36 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 928 bytes --]

> 
> 
>> Can you please guide me as to what I need to load this binary
>> executable file is my generated image file.
> 
> 
> Is this binary statically linked? Otherwise, you have no guarantee that
> it will run on your root filesystem.

It is statically linked file written using c language.

> 
> If so, you could write a recipe to integrate the binary into your root
> filesystem, as it's possible to do with pre-compiled libraries :
> https://docs.yoctoproject.org/dev-manual/common-tasks.html#working-with-pre-built-libraries
> .
> Caution, in this document, the new override syntax (with ":" instead of
> "_") is shown, it doesn't apply to Dunfell.
> 
> I hope this helps
> Cheers
> Michael.
> 
> --
> Michael Opdenacker, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

Will it be okay for me to refer the above link for my specific case?

Thanks and regards,
Hassan

[-- Attachment #2: Type: text/html, Size: 1236 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [yocto] How to compile binary executable files
  2023-03-31  7:36   ` MOHAMMED HASSAN
@ 2023-03-31  7:46     ` Michael Opdenacker
  2023-03-31  9:42       ` MOHAMMED HASSAN
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Opdenacker @ 2023-03-31  7:46 UTC (permalink / raw)
  To: MOHAMMED HASSAN, yocto


On 31.03.23 at 09:36, MOHAMMED HASSAN wrote:
>
>         Can you please guide me as to what I need to load this binary
>         executable file is my generated image file.
>
>
>     Is this binary statically linked? Otherwise, you have no guarantee
>     that
>     it will run on your root filesystem.
>
> It is statically linked file written using c language.


Good then.

>     If so, you could write a recipe to integrate the binary into your
>     root
>     filesystem, as it's possible to do with pre-compiled libraries :
>     https://docs.yoctoproject.org/dev-manual/common-tasks.html#working-with-pre-built-libraries.
>
>     Caution, in this document, the new override syntax (with ":"
>     instead of
>     "_") is shown, it doesn't apply to Dunfell.
>
>     I hope this helps
>     Cheers
>     Michael.
>
>     -- 
>     Michael Opdenacker, Bootlin
>     Embedded Linux and Kernel engineering
>     https://bootlin.com
>
>
> Will it be okay for me to refer the above link for my specific case?


I'd say yes, write a similar recipe for your binary.
Cheers
Michael.

-- 
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to compile binary executable files
  2023-03-31  7:46     ` [yocto] " Michael Opdenacker
@ 2023-03-31  9:42       ` MOHAMMED HASSAN
  2023-03-31  9:50         ` [yocto] " Michael Opdenacker
  0 siblings, 1 reply; 10+ messages in thread
From: MOHAMMED HASSAN @ 2023-03-31  9:42 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 528 bytes --]

If so, you could write a recipe to integrate the binary into your
root
filesystem, as it's possible to do with pre-compiled libraries :
https://docs.yoctoproject.org/dev-manual/common-tasks.html#working-with-pre-built-libraries.

Caution, in this document, the new override syntax (with ":"
instead of
"_") is shown, it doesn't apply to Dunfell.

> 
> Will it be okay for me to refer the above link for my specific case?I'd
> say yes, write a similar recipe for your binary.

Its a .exe binary file. Will it work?

[-- Attachment #2: Type: text/html, Size: 711 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [yocto] How to compile binary executable files
  2023-03-31  9:42       ` MOHAMMED HASSAN
@ 2023-03-31  9:50         ` Michael Opdenacker
  2023-03-31 10:01           ` MOHAMMED HASSAN
  2023-03-31 10:35           ` [yocto] " MOHAMMED HASSAN
  0 siblings, 2 replies; 10+ messages in thread
From: Michael Opdenacker @ 2023-03-31  9:50 UTC (permalink / raw)
  To: MOHAMMED HASSAN, yocto


On 31.03.23 at 11:42, MOHAMMED HASSAN wrote:
> If so, you could write a recipe to integrate the binary into your
> root
> filesystem, as it's possible to do with pre-compiled libraries :
> https://docs.yoctoproject.org/dev-manual/common-tasks.html#working-with-pre-built-libraries.
>
> Caution, in this document, the new override syntax (with ":"
> instead of
> "_") is shown, it doesn't apply to Dunfell.
>
>     Will it be okay for me to refer the above link for my specific
>     case?I'd say yes, write a similar recipe for your binary.
>
> Its a .exe binary file. Will it work?


Not if that's a Windows executable (you can check with the "file" 
command). Just try to run it on your target system a
Cheers
Michael.

-- 
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to compile binary executable files
  2023-03-31  9:50         ` [yocto] " Michael Opdenacker
@ 2023-03-31 10:01           ` MOHAMMED HASSAN
  2023-03-31 10:03             ` MOHAMMED HASSAN
  2023-03-31 10:35           ` [yocto] " MOHAMMED HASSAN
  1 sibling, 1 reply; 10+ messages in thread
From: MOHAMMED HASSAN @ 2023-03-31 10:01 UTC (permalink / raw)
  To: yocto


[-- Attachment #1.1: Type: text/plain, Size: 634 bytes --]

> 
> 
>> Will it be okay for me to refer the above link for my specific
>> case?I'd say yes, write a similar recipe for your binary.
>> 
>> Its a .exe binary file. Will it work?
> 
> 
> Not if that's a Windows executable (you can check with the "file"
> command). Just try to run it on your target system a

Sorry, Ive made some errors here. I just run file command to check, and it seems I was misled by my team into believing it was a statically linked binary.
Ive attached a screenshot for your reference about the type of file it is.
Maybe that would help clear out the mess Ive made.

Thanks and regards,
Hassan

[-- Attachment #1.2: Type: text/html, Size: 869 bytes --]

[-- Attachment #2: Screenshot from 2023-03-31 15-29-24.png --]
[-- Type: image/png, Size: 17234 bytes --]

[-- Attachment #3: Screenshot from 2023-03-31 15-30-43.png --]
[-- Type: image/png, Size: 33982 bytes --]

[-- Attachment #4: Screenshot from 2023-03-31 15-30-43.png --]
[-- Type: image/png, Size: 33982 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to compile binary executable files
  2023-03-31 10:01           ` MOHAMMED HASSAN
@ 2023-03-31 10:03             ` MOHAMMED HASSAN
  0 siblings, 0 replies; 10+ messages in thread
From: MOHAMMED HASSAN @ 2023-03-31 10:03 UTC (permalink / raw)
  To: yocto


[-- Attachment #1.1: Type: text/plain, Size: 1151 bytes --]

On Fri, Mar 31, 2023 at 03:01 AM, MOHAMMED HASSAN wrote:

> 
> 
>> 
>>> Will it be okay for me to refer the above link for my specific
>>> case?I'd say yes, write a similar recipe for your binary.
>>> 
>>> Its a .exe binary file. Will it work?
>> 
>> 
>> Not if that's a Windows executable (you can check with the "file"
>> command). Just try to run it on your target system a
> 
> Sorry, Ive made some errors here. I just run file command to check, and it
> seems I was misled by my team into believing it was a statically linked
> binary.
> Ive attached a screenshot for your reference about the type of file it is.
> 
> Maybe that would help clear out the mess Ive made.
> 
> Thanks and regards,
> Hassan
> 
> 
> 
> 

I think the pictures are not clear so you can refer the attachements.
Ive also copied and pasted what in the attachments here.
*$: file Z3GatewayHostm*
*Z3GatewayHostm: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=5eef6bf3e27434a4e20b7fdd50b3c13f929366ec, with debug_info, not stripped*

[-- Attachment #1.2: Type: text/html, Size: 1449 bytes --]

[-- Attachment #2: Screenshot from 2023-03-31 15-29-24.png --]
[-- Type: image/png, Size: 35192 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [yocto] How to compile binary executable files
  2023-03-31  9:50         ` [yocto] " Michael Opdenacker
  2023-03-31 10:01           ` MOHAMMED HASSAN
@ 2023-03-31 10:35           ` MOHAMMED HASSAN
  2023-03-31 17:11             ` Michael Opdenacker
  1 sibling, 1 reply; 10+ messages in thread
From: MOHAMMED HASSAN @ 2023-03-31 10:35 UTC (permalink / raw)
  To: Michael Opdenacker; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1092 bytes --]

Can you help me to compile for dynamically linked executable file in yocto
dunfell?
Thanks

On Fri, Mar 31, 2023 at 3:20 PM Michael Opdenacker <
michael.opdenacker@bootlin.com> wrote:

>
> On 31.03.23 at 11:42, MOHAMMED HASSAN wrote:
> > If so, you could write a recipe to integrate the binary into your
> > root
> > filesystem, as it's possible to do with pre-compiled libraries :
> >
> https://docs.yoctoproject.org/dev-manual/common-tasks.html#working-with-pre-built-libraries
> .
> >
> > Caution, in this document, the new override syntax (with ":"
> > instead of
> > "_") is shown, it doesn't apply to Dunfell.
> >
> >     Will it be okay for me to refer the above link for my specific
> >     case?I'd say yes, write a similar recipe for your binary.
> >
> > Its a .exe binary file. Will it work?
>
>
> Not if that's a Windows executable (you can check with the "file"
> command). Just try to run it on your target system a
> Cheers
> Michael.
>
> --
> Michael Opdenacker, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
>

[-- Attachment #2: Type: text/html, Size: 1745 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [yocto] How to compile binary executable files
  2023-03-31 10:35           ` [yocto] " MOHAMMED HASSAN
@ 2023-03-31 17:11             ` Michael Opdenacker
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Opdenacker @ 2023-03-31 17:11 UTC (permalink / raw)
  To: MOHAMMED HASSAN; +Cc: yocto

Hi

On 31.03.23 at 12:35, MOHAMMED HASSAN wrote:
> Can you help me to compile for dynamically linked executable file in 
> yocto dunfell?
> Thanks


For a dynamically linked executable you should definitely build it from 
source.
There is no shortcut here. You should take the time to read the Yocto 
manual to know how to do it: https://docs.yoctoproject.org/
Cheers
Michael.

-- 
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-03-31 17:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31  4:34 How to compile binary executable files MOHAMMED HASSAN
2023-03-31  7:25 ` [yocto] " Michael Opdenacker
2023-03-31  7:36   ` MOHAMMED HASSAN
2023-03-31  7:46     ` [yocto] " Michael Opdenacker
2023-03-31  9:42       ` MOHAMMED HASSAN
2023-03-31  9:50         ` [yocto] " Michael Opdenacker
2023-03-31 10:01           ` MOHAMMED HASSAN
2023-03-31 10:03             ` MOHAMMED HASSAN
2023-03-31 10:35           ` [yocto] " MOHAMMED HASSAN
2023-03-31 17:11             ` Michael Opdenacker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).