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

Is compilation working for MacOS? #10

Open
fjtrujy opened this issue Jun 28, 2022 · 3 comments
Open

Is compilation working for MacOS? #10

fjtrujy opened this issue Jun 28, 2022 · 3 comments

Comments

@fjtrujy
Copy link

fjtrujy commented Jun 28, 2022

Hello,
I have tried to compile the project on my MacOS Intel computer OSX 12.2.1 and I'm suffering some compilation issues.
I'm not sure if I miss some dependencies or I'm doing something wrong.

➜  iopmod git:(main) make tool LDFLAGS=-static V=1
cc -O2 -g -Wall -Iinclude -Wp,-MMD,tool/iopmod-info.o.d -MT tool/iopmod-info.o -c -o tool/iopmod-info.o tool/iopmod-info.c
In file included from tool/iopmod-info.c:24:
In file included from include/iopmod/tool/irx.h:9:
include/iopmod/tool/elf32.h:11:10: error: 'elf.h' file not found with <angled> include; use "quotes" instead
#include <elf.h>
         ^~~~~~~
         "elf.h"
In file included from tool/iopmod-info.c:24:
In file included from include/iopmod/tool/irx.h:9:
In file included from include/iopmod/tool/elf32.h:11:
include/iopmod/tool/elf.h:23:1: error: unknown type name 'Elf_Shdr'
Elf_Shdr *elf_first_section(Elf_Ehdr *ehdr);
^
include/iopmod/tool/elf.h:23:29: error: unknown type name 'Elf_Ehdr'
Elf_Shdr *elf_first_section(Elf_Ehdr *ehdr);
                            ^
include/iopmod/tool/elf.h:24:1: error: unknown type name 'Elf_Shdr'
Elf_Shdr *elf_next_section(Elf_Shdr *shdr, Elf_Ehdr *ehdr);
^
include/iopmod/tool/elf.h:24:28: error: unknown type name 'Elf_Shdr'
Elf_Shdr *elf_next_section(Elf_Shdr *shdr, Elf_Ehdr *ehdr);
                           ^
include/iopmod/tool/elf.h:24:44: error: unknown type name 'Elf_Ehdr'
Elf_Shdr *elf_next_section(Elf_Shdr *shdr, Elf_Ehdr *ehdr);
                                           ^
include/iopmod/tool/elf.h:45:21: error: unknown type name 'Elf_Shdr'
void *elf_first_ent(Elf_Shdr *shdr, Elf_Ehdr *ehdr);
                    ^
include/iopmod/tool/elf.h:45:37: error: unknown type name 'Elf_Ehdr'
void *elf_first_ent(Elf_Shdr *shdr, Elf_Ehdr *ehdr);
                                    ^
include/iopmod/tool/elf.h:46:31: error: unknown type name 'Elf_Shdr'
void *elf_next_ent(void *ent, Elf_Shdr *shdr, Elf_Ehdr *ehdr);
                              ^
include/iopmod/tool/elf.h:46:47: error: unknown type name 'Elf_Ehdr'
void *elf_next_ent(void *ent, Elf_Shdr *shdr, Elf_Ehdr *ehdr);
                                              ^
include/iopmod/tool/elf.h:48:28: error: unknown type name 'Elf_Off'
bool elf_offset_in_section(Elf_Off offset, const Elf_Shdr *shdr);
                           ^
include/iopmod/tool/elf.h:48:50: error: unknown type name 'Elf_Shdr'
bool elf_offset_in_section(Elf_Off offset, const Elf_Shdr *shdr);
                                                 ^
include/iopmod/tool/elf.h:49:26: error: unknown type name 'Elf_Addr'
bool elf_addr_in_section(Elf_Addr addr, const Elf_Shdr *shdr);
                         ^
include/iopmod/tool/elf.h:49:47: error: unknown type name 'Elf_Shdr'
bool elf_addr_in_section(Elf_Addr addr, const Elf_Shdr *shdr);
                                              ^
include/iopmod/tool/elf.h:51:26: error: unknown type name 'Elf_Off'
void *elf_ent_for_offset(Elf_Off offset, Elf_Ehdr *ehdr);
                         ^
include/iopmod/tool/elf.h:51:42: error: unknown type name 'Elf_Ehdr'
void *elf_ent_for_offset(Elf_Off offset, Elf_Ehdr *ehdr);
                                         ^
include/iopmod/tool/elf.h:52:24: error: unknown type name 'Elf_Addr'
void *elf_ent_for_addr(Elf_Addr addr, Elf_Ehdr *ehdr);
                       ^
include/iopmod/tool/elf.h:52:39: error: unknown type name 'Elf_Ehdr'
void *elf_ent_for_addr(Elf_Addr addr, Elf_Ehdr *ehdr);
                                      ^
include/iopmod/tool/elf.h:53:1: error: unknown type name 'Elf_Addr'
Elf_Addr elf_addr_for_ent(void *ent, Elf_Ehdr *ehdr);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [tool/iopmod-info.o] Error 1

Could you try to add MacOS as well to your CI/CD workflows to assure it is compiling in macOS as well?

Thanks

@frno7
Copy link
Owner

frno7 commented Jun 29, 2022

Fixed in commit d0711c0 and tested with Darwin 17.7.0.

Could you try to add MacOS as well to your CI/CD workflows to assure it is compiling in macOS as well?

What kind of arch for

arch: [ppc64le, aarch64, x86_64]

would you recommend?

@fjtrujy
Copy link
Author

fjtrujy commented Jun 29, 2022

Fixed in commit d0711c0 and tested with Darwin 17.7.0.

Could you try to add MacOS as well to your CI/CD workflows to assure it is compiling in macOS as well?

What kind of arch for

arch: [ppc64le, aarch64, x86_64]

would you recommend?

macOS just have arm and x86_64, however in GitHubActions we just have x86_64 support within the VM machines.

@frno7
Copy link
Owner

frno7 commented Jun 29, 2022

macOS just have arm and x86_64, however in GitHubActions we just have x86_64 support within the VM machines.

Can the arch matrix be matched up with the runs-on directive

arch: [ppc64le, aarch64, x86_64]
runs-on: ubuntu-latest

in a nice way? I suppose a third set of directives will be needed for Mac OS:

- uses: uraimo/[email protected]
name: Compile ${{ matrix.arch }} IOP tools
if: ${{ matrix.arch != 'x86_64' }}
with:
arch: ${{ matrix.arch }}
# Not required, but speeds up builds
githubToken: ${{ github.token }}
install: |
apt-get update -q -y
apt-get install -q -y git make gcc libc-dev
run: |
# Avoid fatal: unsafe repository ('/home/runner/work/iopmod/iopmod' is owned by someone else)
git config --global --add safe.directory "$PWD"
make tool LDFLAGS=-static V=1
tar czvf "iopmod-tools-${{ env.ARCHIVE_TAG }}.tar.gz" tool/iopmod-{info,link,symc}
- name: Compile x86_64 IOP tools
if: ${{ matrix.arch == 'x86_64' }}
run: |
make tool LDFLAGS=-static V=1
tar czvf "iopmod-tools-${{ env.ARCHIVE_TAG }}.tar.gz" tool/iopmod-{info,link,symc}

Would you know of any working examples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants