Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to compile in docker to different architecture? #30

Open
lars18th opened this issue Jan 21, 2023 · 7 comments
Open

How to compile in docker to different architecture? #30

lars18th opened this issue Jan 21, 2023 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@lars18th
Copy link

Hi,

Now we can compile xfrpc inside a container with static support. However, I need to know how to compile not only for x86, but for example ARM for Android device, mips32 for OpenWRT device, etc.

Any idea?

@liudf0716
Copy link
Owner

@lars18th XFRPC has already been adopted by the OpenWRT project, which supports a wide range of hardware platforms such as ARM, MIPS and so on.

@lars18th
Copy link
Author

lars18th commented Feb 1, 2023

Hi @liudf0716 ,

Yes, I know it. However, I need to compile it statically for a different platform (not OpenWRT). So, you know how to compile it inside the Docker container for mips32 device?

Thank you.

@liudf0716
Copy link
Owner

@lars18th I haven't done the research yet, maybe someone else can do it for you.

@liudf0716 liudf0716 added the help wanted Extra attention is needed label Feb 1, 2023
@helintongh
Copy link
Collaborator

You are talking about cross compiling.There will be a document describing how to cross-compile the corresponding binary through arm-gcc or mips-gcc.

@lars18th
Copy link
Author

lars18th commented Feb 4, 2023

You are talking about cross compiling.There will be a document describing how to cross-compile the corresponding binary through arm-gcc or mips-gcc.

Thank you. I want to see this document soon.
Regards.

@helintongh
Copy link
Collaborator

Now supports cross-compiling xfrpc for mips architecture or arm architecture on x86.
See pr #36 .
Execute the following command in ubuntu 22.04:

sudo apt-get install gcc-mips-linux-gnu # install mips-gcc compiler
mkdir build && cd build
cmake -DTHIRDPARTY_STATIC_BUILD=mips -DCMAKE_C_COMPILER=mips-linux-gnu-gcc ..
make

get mips xfrpc.

image

@lars18th
Copy link
Author

lars18th commented Feb 6, 2023

Hi @helintongh ,

Thank you. I'll check it with the docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants