-
Notifications
You must be signed in to change notification settings - Fork 452
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
Re mk cross build2 #1161
Re mk cross build2 #1161
Conversation
3fc9a31
to
505ac87
Compare
.github/workflows/build.yml
Outdated
make V=1 CCACHE= info test modules | ||
make clean; make CCACHE= STATIC=yes | ||
make V=1 CCACHE= SYSROOT_LOCAL=/usr/local info info2 test modules | ||
make clean; make CCACHE= SYSROOT_LOCAL=/usr/local STATIC=yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macOS should not require any special args to build. A simple make
should be sufficient to build baresip on all supported platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if one specifies SYSROOT for a cross compilation build then it is not common to include /usr/local into the header search paths.
e.g. yocto says:
cc1: warning: include location "/usr/local/include/rem" is unsafe for cross-compilation [-Wpoison-system-directories]
I couldn't see where SYSROOT is set for the maxOS build. Can we fix this differently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SYSROOT for macOS is defined here https://github.com/baresip/re/blob/master/mk/re.mk#L238
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I added /usr/local as fallback. Also no warning/error in our yocto build.
.github/workflows/build.yml
Outdated
@@ -79,5 +79,5 @@ jobs: | |||
- name: make baresip macOS | |||
if: ${{ runner.os == 'macOS' }} | |||
run: | | |||
make V=1 CCACHE= info test modules | |||
make clean; make CCACHE= STATIC=yes | |||
make V=1 CCACHE= SYSROOT_LOCAL=/usr/local info info2 test modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is info2
only for debugging used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Like info. The info target is defined in re.mk. And the variables LIBREM_PATH, ... are not included. Should I remove it or rename it?
a415fef
to
77a6919
Compare
Makefile
Outdated
@@ -329,3 +367,10 @@ src/static.c: $(BUILD) Makefile $(APP_MK) $(MOD_MK) | |||
done | |||
@echo " NULL" >> $@ | |||
@echo "};" >> $@ | |||
|
|||
.PHONY: info2 | |||
info2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can now replace:
.PHONY: info2
info2:
by:
info::
https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html#Double_002dColon
bd4a8d3
to
47d27cb
Compare
I tested on OSX with GNU make 3.81 and got this error:
|
Looks like this re commit baresip/re@432fa6a is missing? |
If you want to use double-colon targets, it makes a hard depencency that baresip and re baresip (commit 29. dec) -> re (commit 29. dec) it will for example make it difficult to use baresip from 29. dec +/- 1 day with libre 28. dec or older. it is guaranteed that this will cause many support requests from users. a simpler and more flexible solution is:
|
This fixes cross compilation builds without having to set both SYSROOT and SYSROOT_LOCAL.
We always set an adequate LIBREM_PATH and add new variables LIBREM_INC, LIBREM_SO that are used for CFLAGS and LFLAGS. Check if ../rem directory exists first. Then check if rem.h exists in SYSROOT_LOCAL first. At least in SYSROOT.
Similar to LIBRE_INC and LIBRE_SO in re.mk.
ecbe1fa
to
3b4031d
Compare
From my side it is ready to merge now. Tested in yocto recipe:
|
thanks! |
This fixes cross compilation builds without having to set both SYSROOT and
SYSROOT_LOCAL.
More concretely, it avoids that the fallback value of SYSROOT_LOCAL leads to:
Also LIBREM_PATH was made to always point to the rem directory and added LIBREM_INC and LIBREM_SO.
Not part of this PR:
Another improvement would be to add a rem.mk to rem that adequately sets LIBREM_PATH, LIBREM_INC and LIBREM_SO similar to re.mk for the LIBRE_xxx variables. Let me know if you prefer this!