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

erlang compilation is failing #3770

Closed
digitalbox94 opened this issue Sep 13, 2019 · 9 comments · Fixed by #4333
Closed

erlang compilation is failing #3770

digitalbox94 opened this issue Sep 13, 2019 · 9 comments · Fixed by #4333

Comments

@digitalbox94
Copy link

digitalbox94 commented Sep 13, 2019

Setup

Package Name: Erlang
Package Version: R16B03-1

NAS Model: DS 716+II
NAS Architecture: braswell
DSM version: 6.1

Expected behavior

The Erlang compilation in the cross directory should compile fine

Actual behavior

The error appear below :
In file included from beam/erl_threads.h:267:0,
from beam/erl_smp.h:27,
from beam/sys.h:416,
from hipe/hipe_bif0.c:27:
hipe/hipe_amd64_primops.h:21:13: erreur: «am_inc_stack_0» non déclaré ici (hors de toute fonction)
PRIMOP_LIST(am_inc_stack_0, &nbif_inc_stack_0)
^

Steps to reproduce

1. In the Spksrc directory : make setup
2. cd native/erlang
3. make
2. cd cross/erlang
3. make arch-braswell

@digitalbox94
Copy link
Author

Investigation on going and moving forward : in native/erlang, even if the definition of "am_inc_stack_0" is available in erl_atom_table.h, the cross part can't find it

So next step is to indicate where the "erl_atom_table.h" is : it might be a missing option in the configure of cross/erlang

Relative path is : ./work-native/otp_src_R16B03-1/erts/emulator/x86_64-unknown-linux-gnu/erl_atom_table.h:961:#define am_inc_stack_0 make_atom(951)

@ymartin59
Copy link
Contributor

@digitalbox94 Thanks for your investigations. Do not hesitate to submit PR with fix proposal, even in draft version as "work-in-progress", so that we may review and/or go further....

@digitalbox94
Copy link
Author

Moving forward : I didn't identified so far the root cause of the error in the cross compilation process.
I decided to not use spksrc as a first step and cross-compile from scratch Erlang. The good news is that it cross-compiled fine for braswell arch. My aim was to compile rabbitmq-server, where I have also succeed in compiling it once Erlang compiler was available. rabbitmq-server seems to launch without any error :)
Now I have a good comparison criteria between cross compilation via spksrc and cross compilation without to understand where the things go wrong with spksrc and Erlang

@digitalbox94
Copy link
Author

rabbitmq

@digitalbox94
Copy link
Author

digitalbox94 commented Oct 1, 2019

Moving forward, I have the below :

  • cross compilation from linux-x86_64 to braswell (64 bits) without spksrc : ok
  • cross compilation from linux-x86_64 to evansport (32 bits) without spksrc : ok
  • cross compilation from linux-x86_64 to braswell (64 bits) with spksrc : ok
  • cross compilation from linux-x86_64 to evansport (32 bits) with spksrc : ko

=> Erlang cross compilation is expecting "--host" and "--build" options defined during the configure phase, however for an unknown reason SPKSRC doesn't "like" these options as I have the below error message for evansport :

LD ../priv/lib/x86-unknown-none/dyntrace.so
[...]/bin/i686-pc-linux-gnu-ld : option « -Wl,--rpath-link,[...]work-evansport-6.1/install//usr/local/erlang/lib » non reconnue

The same error is also raised when using the "--host" and "--build" options for braswell.

I can give more details or propose a PR if someone wants to look at it. I don't have this kind of error without SPKSRC, so I'm curious to know where it comes from.

@digitalbox94
Copy link
Author

rabbitmq erlang

It's possible to have both Erlang and RabbitMQ as separate packages. Unfortunately I didn't use spksrc due to the above reasons.

@hgy59
Copy link
Contributor

hgy59 commented Oct 14, 2019

A PR would be welcome.
If you define GNU_CONFIGURE = 1 in the Makefile, the --host and --build parameters should be set in the configure step. To solve other issues one can use CONFIGURE_ARGS. And sometimes a custom pre-configure step is needed to call autoconf or similar tool.
If the projects are not created with cross compilation in mind, sometimes patching configure or make files is needed.

@digitalbox94
Copy link
Author

Not sure to understand at which level the --host will be deduced here : is it by the SPKSRC tool or is it by the configure script included in the source of the software to port ?

One possibility is to have a mapping between each synology arch (braswell, evansport, etc) and the corresponding "--host" variable : it could be done at SPKSRC level and it might solve some issues in the cross compilation process :)

I will continue to have a look at it, because by "hardcoding" the --host / --build part, I have much more software passing the cross compilation (Erlang, RabbitMQ, IOQuake, PostgreSQL, ...) at least for my NAS model :)

@hgy59 hgy59 mentioned this issue Dec 27, 2020
3 tasks
@hgy59
Copy link
Contributor

hgy59 commented Feb 25, 2021

Erlang and RabbitMQ are released with #4437

@hgy59 hgy59 closed this as completed Feb 25, 2021
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

Successfully merging a pull request may close this issue.

3 participants