Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ AC_ARG_ENABLE(redis-test,
esac],[rtest=false])
AM_CONDITIONAL(RTEST, test x$rtest = xtrue)

AM_CONDITIONAL(ARCH64, test `getconf LONG_BIT` = "64")
if test x$CONFIGURED_ARCH = xarmhf && test x$CROSS_BUILD_ENVIRON = xy; then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about this one ? CROSS_BUILD_ENVIRON ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know exactly how to fix it. We can't run getconf on host machine to determine ARCH64 of the target machine. Do you want me to pass ARCH64 env. variable and check if it is already defined then do nothing otherwise test getconf ? Any other suggestion ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not that familiar with proper way to pass cross compiling flags and whether that approach will be suitable for sonic, are you the only one working on this? maybe this would require some broader audience ?
i found this example for kernel https://www.centennialsoftwaresolutions.com/post/stop-typing-make-arch-arm-cross_compile-arm-linux-gnueabi-o-when-building-the-linux-kernel

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working alone, but Antony Rheneus is helping me. What specifically is not good in the current confugure.ac code ? That CONFIGURED_ARCH and CROSS_BUILD_ENVIRON variables from Sonic are exposed ? That it is not generic solution for cross-compilation ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing wrong, just wondering that there should be already established some common way to crosscompile in makefiles

AM_CONDITIONAL(ARCH64, false)
else
AM_CONDITIONAL(ARCH64, test `getconf LONG_BIT` = "64")
fi

AC_PATH_PROGS(SWIG, [swig3.0 swig])

Expand Down
3 changes: 2 additions & 1 deletion python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ from distutils.command.build_ext import build_ext
from distutils.sysconfig import customize_compiler
import os

os.environ["CC"] = "g++"
os.environ["CC"] = os.getenv("CROSS_COMPILE", "") + "g++"
os.environ["CXX"] = os.getenv("CROSS_COMPILE", "") + "g++"

swss_common_inc_dir = '@SWSS_COMMON_INC_DIR@'

Expand Down