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

cross build regressed wrt System.Native and "shm_open that works well enough with mmap" #9951

Closed
jaykrell opened this issue Aug 8, 2018 · 18 comments
Labels

Comments

@jaykrell
Copy link
Collaborator

@jaykrell jaykrell commented Aug 8, 2018

Steps to Reproduce

  1. on e.g. linux amd64:
    ./autogen.sh CFLAGS="-g -O0" -disable-nls -disable-system-aot --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc -enable-cross-compiling

Current Behavior

.
.
.
checking for shm_open that works well enough with mmap... configure: error: in `/s/mono3':
configure: error: cannot run test program while cross compiling
See `config.log' for more details

Expected Behavior

Uncertain. Perhaps success and compile and link, perhaps not.
Maybe cross builds too esoteric.

We have defaults in some places and don't run programs.

      dnl ***********************************
        dnl *** Checks for working __thread ***
        dnl ***********************************
        AC_MSG_CHECKING(for working __thread)
        if test "x$with_tls" != "x__thread"; then
                AC_MSG_RESULT(disabled)
        elif test "x$cross_compiling" = "xyes"; then
                AC_MSG_RESULT(cross compiling, assuming yes)
        else
                AC_TRY_RUN([
  

and

        dnl **************************************
        dnl *** Checks for working sigaltstack ***
        dnl **************************************
        AC_MSG_CHECKING(for working sigaltstack)
        if test "x$with_sigaltstack" != "xyes"; then
                AC_MSG_RESULT(disabled)
        elif test "x$cross_compiling" = "xyes"; then
                AC_MSG_RESULT(cross compiling, assuming yes)
        else
                AC_TRY_RUN([

but:

       AC_MSG_CHECKING(for shm_open that works well enough with mmap)
        if test "x$ac_cv_func_shm_open" = "xno" -o "x$ac_cv_func_shm_open_working_with_mmap" = "xno" ; then
                AC_MSG_RESULT(no)
        else
                AC_TRY_RUN([

therefore:

checking for shm_open that works well enough with mmap... configure: error: in `/s/mono3':
configure: error: cannot run test program while cross compiling

Is there a good default maybe?
This came in prematurely with System.Native ahead of its memory mapped file support?
Which is coming?

Anyway, I'll just set ac_cv_func_shm_open_working_with_mmap and move on.

On which platforms did you notice this

Linux

@jaykrell

This comment has been minimized.

Copy link
Collaborator Author

@jaykrell jaykrell commented Aug 8, 2018

I will workaround by setting ac_cv_func_shm_open.

@solabc16

This comment has been minimized.

Copy link

@solabc16 solabc16 commented Oct 8, 2018

Hello - did anything further happen with this? I've just tried to cross-compile 5.16.0.179 for arm64, to start testing.

configure:25883: checking for shm_open that works well enough with mmap
configure:25890: error: in `/source/mono':
configure:25892: error: cannot run test program while cross compiling
See `config.log' for more details

Best

  • James
@solabc16

This comment has been minimized.

Copy link

@solabc16 solabc16 commented Oct 9, 2018

FYI, this is the minimal configure we needed to reproduce, whilst trying to cross compile for AArch64.

We've built and are currently running the following releases without issue on this arch: 5.10.1.57, 5.12.0.301 & 5.14.0.177.

./configure
	--prefix=/source/mono/test
	--build=x86_64-linux-gnu
	--host=aarch64-unknown-linux-gnueabi
	--disable-mcs-build

Best

  • James
@mandawah

This comment has been minimized.

Copy link
Contributor

@mandawah mandawah commented Oct 11, 2018

Hello,
Same here with --host=arm-linux-gnueabihf
Previous versions had no issues.

Thanks.

@m4tt075

This comment has been minimized.

Copy link

@m4tt075 m4tt075 commented Oct 20, 2018

Same here when trying to update Synology packages via the spksrc cross-compilation framework...
https://github.com/SynoCommunity/spksrc/tree/master/cross/mono
@jaykrell Could you share how you've worked around the problem, please?

@jbatt33

This comment has been minimized.

Copy link

@jbatt33 jbatt33 commented Nov 8, 2018

I feel the pain of this as well with : arm-angstrom-linux-gnueabi

@jbatt33

This comment has been minimized.

Copy link

@jbatt33 jbatt33 commented Nov 8, 2018

Wrapped that part of the configure step with :

if test "x$host" == "x$target"; then

Get's me past this... I'm not too sure how to solve this as my target does support the test it is attempting to run....

@jbatt33

This comment has been minimized.

Copy link

@jbatt33 jbatt33 commented Nov 8, 2018

Wrapped that part of the configure step with :

if test "x$host" == "x$target"; then

Get's me past this... I'm not too sure how to solve this as my target does support the test it is attempting to run....

--I thought that was working for me, but bitbake hurt me a little. I changed my local build to just check for "arm " in the target name. It appears that at this point the configuration has the host and the target set to the same values. Oh well. Hope this is resolved. Thanks everyone.

@ShonkyCH

This comment has been minimized.

Copy link
Contributor

@ShonkyCH ShonkyCH commented Nov 26, 2018

Wrapped that part of the configure step with :
if test "x$host" == "x$target"; then
Get's me past this... I'm not too sure how to solve this as my target does support the test it is attempting to run....

--I thought that was working for me, but bitbake hurt me a little. I changed my local build to just check for "arm " in the target name. It appears that at this point the configuration has the host and the target set to the same values. Oh well. Hope this is resolved. Thanks everyone.

@jbatt33 : Could you detail where you set this up with bitbake/Yocto? I have the same issue. Do you have your own mono recipe or are you just using the meta-mono layer with a .bbappend? I have created some extra recipes for the newer mono releases which otherwise look to compile and run fine (well 5.14 release does)

edit: Fixed configure.ac as per the first post to configure OK but then run into this one: #11744

@jbatt33

This comment has been minimized.

Copy link

@jbatt33 jbatt33 commented Nov 28, 2018

Wrapped that part of the configure step with :
if test "x$host" == "x$target"; then
Get's me past this... I'm not too sure how to solve this as my target does support the test it is attempting to run....

--I thought that was working for me, but bitbake hurt me a little. I changed my local build to just check for "arm " in the target name. It appears that at this point the configuration has the host and the target set to the same values. Oh well. Hope this is resolved. Thanks everyone.

@jbatt33 : Could you detail where you set this up with bitbake/Yocto? I have the same issue. Do you have your own mono recipe or are you just using the meta-mono layer with a .bbappend? I have created some extra recipes for the newer mono releases which otherwise look to compile and run fine (well 5.14 release does)

edit: Fixed configure.ac as per the first post to configure OK but then run into this one: #11744

Using the standard mono-layer with bitbake, except a LOCAL check out of mono repo instead of patching the release from git. each time it builds.

@ShonkyCH

This comment has been minimized.

Copy link
Contributor

@ShonkyCH ShonkyCH commented Nov 29, 2018

Ok, thanks. Attached patch fixes the configuration issue, but then hits #11744

fix_shm_open_issue.patch.txt

Edit: oops attached wrong patch initially.

@m4tt075 m4tt075 referenced this issue Dec 30, 2018
2 of 3 tasks complete
@m4tt075

This comment has been minimized.

Copy link

@m4tt075 m4tt075 commented Dec 30, 2018

@ShonkyCH I can confirm that your patch fixed the issue for me. As it will probably help others, too, do you want to PR it?

@solabc16

This comment has been minimized.

Copy link

@solabc16 solabc16 commented Dec 31, 2018

Hello - as a more general observation, is there anything we can do to assist with arm/arm64 release testing? As far as I can tell this was broken 'out of the box', with the issue being raised before 5.16.0.179 was released 2018-10-05.

Best

  • James
ShonkyCH added a commit to ShonkyCH/mono that referenced this issue Jan 4, 2019
Fixes mono#9951
monojenkins added a commit that referenced this issue Jan 14, 2019
Fix cross compile issue introduced in 5.16

Fixes #9951
@ajlennon

This comment has been minimized.

Copy link
Contributor

@ajlennon ajlennon commented Jan 24, 2019

@solabc16 - if anybody wants to send PRs to me for updates to Poky meta-mono to support new releases these will auto-build on my Jenkins instance. It also does some very basic runtime sanity checks.

https://github.com/dynamicdevices/meta-mono

http://jenkins.dynamicdevices.co.uk:8080/job/meta-mono

@solabc16

This comment has been minimized.

Copy link

@solabc16 solabc16 commented Jan 27, 2019

Thanks @ajlennon

monojenkins added a commit to monojenkins/mono that referenced this issue Jan 28, 2019
marek-safar added a commit that referenced this issue Feb 4, 2019
akoeplinger added a commit that referenced this issue Feb 4, 2019
* Fix cross compile issue introduced in 5.16

Fixes #9951

* Update configure.ac

Define HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP in the cross-compilation case also (since we are "assuming yes")
@Apteryks

This comment has been minimized.

Copy link

@Apteryks Apteryks commented Feb 8, 2019

Hello! Sadly the fix didn't have an effect on my side. I used the latest released mono archive (5.18.0.240) patched it with the patches from commit 97e410a
config.log
797872f84 and fa290a6 (there was an offset 9 but I verified the fix applied correctly) and retried compilation. I still get the:

[...]
checking for bind with unsigned addrlen... no
checking for struct ipv6_mreq with unsigned ipv6mr_interface... no
checking for inotify_rm_watch with unsigned wd... no
checking for shm_open that works well enough with mmap... configure: error: in `/some/path/build_dir/target-x86_64-centos7-linux-gnu/mono-5.18.0.240':
configure: error: cannot run test program while cross compiling
See `config.log' for more details

I've attached the full config.log for forensics.
config.log.txt

@solabc16

This comment has been minimized.

Copy link

@solabc16 solabc16 commented Feb 8, 2019

Hello @Apteryks

Did you run autoreconf after applying the patch? e.g.

autoreconf -fiv

Best
- James

@Apteryks

This comment has been minimized.

Copy link

@Apteryks Apteryks commented Feb 11, 2019

@solabc16 Indeed, my bad! Thanks for the hint :-)

jonpryor added a commit to xamarin/xamarin-android that referenced this issue Apr 24, 2019
Bumps to mono/api-snapshot@ae01378
Bumps to mono/reference-assemblies@e5173a5
Bumps to mono/bockbuild@d30329d
Bumps to mono/boringssl@3d87996
Bumps to mono/corefx@72f7d76
Bumps to mono/corert@1b7d4a1
Bumps to mono/helix-binaries@7e893ea
Bumps to mono/illinker-test-assets@f21ff68
Bumps to mono/linker@13d864e
Bumps to mono/llvm@1aaaaa5 [mono]
Bumps to mono/llvm@2c2cffe [xamarin-android]
Bumps to mono/NUnitLite@0029561
Bumps to mono/roslyn-binaries@0bbc9b4
Bumps to mono/xunit-binaries@8f6e62e

	$ git diff --shortstat 886c4901..e66c7667      # mono
        3597 files changed, 350850 insertions(+), 91128 deletions(-)
	$ git diff --shortstat 349752c464c5fc93b32e7d45825f2890c85c8b7d..2c2cffedf01e0fe266b9aaad2c2563e05b750ff4
	 240 files changed, 18562 insertions(+), 6581 deletions(-)

Context: dotnet/coreclr#22046

Fixes: CVE 2018-8292 on macOS
Fixes: http://work.devdiv.io/737323
Fixes: dotnet/corefx#33965
Fixes: dotnet/standard#642
Fixes: mono/mono#6997
Fixes: mono/mono#7326
Fixes: mono/mono#7517
Fixes: mono/mono#7750
Fixes: mono/mono#7859
Fixes: mono/mono#8360
Fixes: mono/mono#8460
Fixes: mono/mono#8766
Fixes: mono/mono#8922
Fixes: mono/mono#9418
Fixes: mono/mono#9507
Fixes: mono/mono#9951
Fixes: mono/mono#10024
Fixes: mono/mono#10030
Fixes: mono/mono#10038
Fixes: mono/mono#10448
Fixes: mono/mono#10735
Fixes: mono/mono#10735
Fixes: mono/mono#10737
Fixes: mono/mono#10743
Fixes: mono/mono#10834
Fixes: mono/mono#10837
Fixes: mono/mono#10838
Fixes: mono/mono#10863
Fixes: mono/mono#10945
Fixes: mono/mono#11020
Fixes: mono/mono#11021
Fixes: mono/mono#11021
Fixes: mono/mono#11049
Fixes: mono/mono#11091
Fixes: mono/mono#11095
Fixes: mono/mono#11123
Fixes: mono/mono#11138
Fixes: mono/mono#11146
Fixes: mono/mono#11202
Fixes: mono/mono#11214
Fixes: mono/mono#11317
Fixes: mono/mono#11326
Fixes: mono/mono#11378
Fixes: mono/mono#11385
Fixes: mono/mono#11478
Fixes: mono/mono#11479
Fixes: mono/mono#11488
Fixes: mono/mono#11489
Fixes: mono/mono#11527
Fixes: mono/mono#11529
Fixes: mono/mono#11596
Fixes: mono/mono#11603
Fixes: mono/mono#11613
Fixes: mono/mono#11623
Fixes: mono/mono#11663
Fixes: mono/mono#11681
Fixes: mono/mono#11684
Fixes: mono/mono#11693
Fixes: mono/mono#11697
Fixes: mono/mono#11779
Fixes: mono/mono#11809
Fixes: mono/mono#11858
Fixes: mono/mono#11895
Fixes: mono/mono#11898
Fixes: mono/mono#11898
Fixes: mono/mono#11965
Fixes: mono/mono#12182
Fixes: mono/mono#12193
Fixes: mono/mono#12218
Fixes: mono/mono#12235
Fixes: mono/mono#12263
Fixes: mono/mono#12307
Fixes: mono/mono#12331
Fixes: mono/mono#12362
Fixes: mono/mono#12374
Fixes: mono/mono#12402
Fixes: mono/mono#12421
Fixes: mono/mono#12461
Fixes: mono/mono#12479
Fixes: mono/mono#12479
Fixes: mono/mono#12552
Fixes: mono/mono#12603
Fixes: mono/mono#12747
Fixes: mono/mono#12831
Fixes: mono/mono#12843
Fixes: mono/mono#12881
Fixes: mono/mono#13030
Fixes: mono/mono#13284
Fixes: mono/mono#13297
Fixes: mono/mono#13455
Fixes: mono/mono#13460
Fixes: mono/mono#13478
Fixes: mono/mono#13479
Fixes: mono/mono#13522
Fixes: mono/mono#13607
Fixes: mono/mono#13610
Fixes: mono/mono#13610
Fixes: mono/mono#13639
Fixes: mono/mono#13672
Fixes: mono/mono#13834
Fixes: mono/mono#13878
Fixes: mono/mono#6352
Fixes: mono/monodevelop#6898
Fixes: xamarin/maccore#1069
Fixes: xamarin/maccore#1407
Fixes: xamarin/maccore#604
Fixes: xamarin/xamarin-macios#4984
Fixes: xamarin/xamarin-macios#5289
Fixes: xamarin/xamarin-macios#5363
Fixes: xamarin/xamarin-macios#5381
Fixes: https://issuetracker.unity3d.com/issues/editor-crashes-with-g-logv-when-entering-play-mode-with-active-flowcanvas-script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.