Sysprogs forums › Forums › VisualGDB › Yocto-Linux
- This topic has 42 replies, 2 voices, and was last updated 8 years, 5 months ago by support.
-
AuthorPosts
-
April 23, 2016 at 17:37 #8058peter_czParticipant
Dears,
is it possible to use VisualGDB (in connection with MS Visual Studio) for cross development for Yocto-Linux. DO you have any experiance on this?
Thank you.
peter_cz
April 23, 2016 at 20:39 #8063supportKeymasterHi,
Yes, as long as you have a cross-toolchain for your distro. E.g. see the Intel Edison tutorial: http://visualgdb.com/tutorials/linux/edison/
You can also compile your code directly on the device or order a cross-toolchain from us if you don’t have one.
April 23, 2016 at 22:37 #8064peter_czParticipantI have i.MX6QP board and built my distro & toolchain
April 23, 2016 at 23:00 #8065supportKeymasterHi,
Then you should be able to configure VisualGDB similarly to the Edison tutorial. Let us know if you encounter any problems.
May 9, 2016 at 16:03 #8185peter_czParticipantHello,
I do have my cross-tool-chain compiled on my Linux machine (server) , I’d like to use VisualGDB for cross-compilation . Per http://visualgdb.com/tutorials/linux/edison/ I should install compiler and other files necessary to build and debug the code.
How should I do that (install cross tool chain on my windows machine) since I have all cross toolchain on my Linux server machine?
Thanks.
Peter
May 9, 2016 at 18:26 #8186supportKeymasterHi,
We have just published a tutorial on this: http://visualgdb.com/tutorials/linux/3machine/
Let us know if it leaves any questions unanswered.
May 9, 2016 at 19:13 #8187peter_czParticipantI do want to build the project locally with cross compiler. I do have my cross tool-chain on Linux server on host machine, I do not have tool chain on my target. So I am looking for a way to build it locally on my local “Windows” machine.
The tutorial does not fit what I am looking for .
May 9, 2016 at 19:33 #8188peter_czParticipantMy situation is as:
I have a host server (building machine) to build Linux distribution for target embedded ARM but not for local host (server = build machine). I use Yocto project to build Linux for me and as well to build cross toolchain for this embedded target. There is none tool-chain on target, cross tool chain is on server host. For now I use cross compilation on server host.
How can VisualGDB help with development? Either to automate development on Windows pointing to “Remote computer = server host” and then deploy on target (Build the project under Linux over network & deploy project to another Linux computer)? Or is it possible somehow to have “Linux based cross-tool-chain” on Windows machine and build it locally with this cross-compiler and deploy on to target (Build the project locally with cross compiler)?
Thank you for your help.
May 9, 2016 at 19:45 #8189peter_czParticipantCross-Development Toolchain Generation¶
May 10, 2016 at 04:54 #8193supportKeymasterHi,
It is possible to build a cross-compiler for Windows, but it’s non-trivial and error-prone. We do provide very basic instructions here, however in many cases things don’t work out-of-the-box and need additional fixing. We could build a Windows cross- toolchain for you as a service (contact our sales to get a quote), or you can just setup VisualGDB to build everything on your Linux machine with the cross-toolchain and deploy it to the ARM board like shown in the tutorial mentioned earlier. The second option does not require building an extra toolchain and once you configure a project, will do everything automatically.
May 10, 2016 at 12:54 #8197peter_czParticipantIn your tutorial you’re point to (“Specify toolchain manually”) *gdb… In my case I do have script to Source the cross-toolchain environment setup and none *gdb. that make sure to call gcc for cross-compilation. Yocto build system uses the host <code class=”filename”>gcc compiler to bootstrap a cross-compiler named <code class=”filename”>gcc-cross but first need to call script to right source for cross toolchain.
What/how to call “Remote toolchain”?
May 10, 2016 at 16:02 #8198peter_czParticipantIf I do cross compilation on server host I follow::
- source /home/username/buildtools/enviroment-setup*poky-linux //Source the tools environment setup script
export SDKTARGETSYSROOT=/opt/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
export PATH=/opt/sysroots/x86_64-pokysdk-linux/usr/bin:/opt/PeterB/sysroots/x86_64-pokysdk-linux/usr/bin/../x86_64-pokysdk-linux/bin:/opt/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:/opt/PeterB/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-uclibc:/opt/PeterB/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-musl:$PATH
export CCACHE_PATH=/opt/PeterB/sysroots/x86_64-pokysdk-linux/usr/bin:/opt/sysroots/x86_64-pokysdk-linux/usr/bin/../x86_64-pokysdk-linux/bin:/opt/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:/opt/PeterB/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-uclibc:/opt/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-musl:$CCACHE_PATH
export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT
export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib/pkgconfig
export CONFIG_SITE=/opt/PeterB/site-config-cortexa9hf-vfp-neon-poky-linux-gnueabi
export OECORE_NATIVE_SYSROOT="/opt/PeterB/sysroots/x86_64-pokysdk-linux"
export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"
export OECORE_ACLOCAL_OPTS="-I /opt/sysroots/x86_64-pokysdk-linux/usr/share/aclocal"
export PYTHONHOME=/opt/PeterB/sysroots/x86_64-pokysdk-linux/usr
unset command_not_found_handle
export CC="arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=$SDKTARGETSYSROOT"
export CXX="arm-poky-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=$SDKTARGETSYSROOT"
export CPP="arm-poky-linux-gnueabi-gcc -E -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=$SDKTARGETSYSROOT"
export AS="arm-poky-linux-gnueabi-as "
export LD="arm-poky-linux-gnueabi-ld --sysroot=$SDKTARGETSYSROOT"
export GDB=arm-poky-linux-gnueabi-gdb
export STRIP=arm-poky-linux-gnueabi-strip
export RANLIB=arm-poky-linux-gnueabi-ranlib
export OBJCOPY=arm-poky-linux-gnueabi-objcopy
export OBJDUMP=arm-poky-linux-gnueabi-objdump
export AR=arm-poky-linux-gnueabi-ar
export NM=arm-poky-linux-gnueabi-nm
export M4=m4
export TARGET_PREFIX=arm-poky-linux-gnueabi-
export CONFIGURE_FLAGS="--target=arm-poky-linux-gnueabi --host=arm-poky-linux-gnueabi --build=x86_64-linux --with-libtool-sysroot=$SDKTARGETSYSROOT"
export CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types"
export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types"
export LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
export CPPFLAGS=""
export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"
export OECORE_DISTRO_VERSION="4.1.15-1.1.1"
export OECORE_SDK_VERSION="4.1.15-1.1.1"
export ARCH=arm
export CROSS_COMPILE=arm-poky-linux-gnueabi-
# Append environment subscripts
if [ -d "$OECORE_TARGET_SYSROOT/environment-setup.d" ]; then
for envfile in $OECORE_TARGET_SYSROOT/environment-setup.d/*.sh; do
source $envfile
done
fi
if [ -d "$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
for envfile in $OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
source $envfile
done
fi
- make //helloworld example
APPNAME = helloworld
DESTDIR = ../bin
SRCDIR = ../src
#CXX = $(CROSS_COMPILE)g++
DEL_FILE = rm -rf
CP_FILE = cp -rf
ROOTFS_DIR = $(SDKTARGETSYSROOT)
TARGET_PATH_LIB = $(ROOTFS_DIR)/usr/lib
TARGET_PATH_INCLUDE = $(ROOTFS_DIR)/usr/include
CFLAGS = -DLINUX -DUSE_SOC_MX6 -Wall -O2 -fsigned-char -march=armv7-a -mfpu=neon -mthumb-interwork -mtune=cortex-a9 -mfpu=vfp -mfloat-abi=hard \
-DEGL_API_FB -DGPU_TYPE_VIV -DGL_GLEXT_PROTOTYPES -DENABLE_GPU_RENDER_20 \
-I. -I$(TARGET_PATH_INCLUDE) \
-I$(TARGET_PATH_INCLUDE)/glib-2.0 -I$(TARGET_PATH_LIB)/glib-2.0/include \
-I$(TARGET_PATH_INCLUDE)/libxml2 \
LFLAGS = -Wl,--library-path=$(TARGET_PATH_LIB),-rpath-link=$(TARGET_PATH_LIB) -lm
OBJECTS = $(APPNAME).o
first: all
all: $(APPNAME)
$(APPNAME): $(OBJECTS)
$(CXX) $(LFLAGS) -o $(DESTDIR)/$(APPNAME) $(OBJECTS)
$(APPNAME).o: $(APPNAME).cpp
$(CXX) $(CFLAGS) -c -o $(APPNAME).o $(APPNAME).cpp
clean:
$(DEL_FILE) $(SRCDIR)/$(OBJECTS)
$(DEL_FILE) $(DESTDIR)/$(OBJECTS)
$(DEL_FILE) $(DESTDIR)/*~ $(DESTDIR)/*.core
$(DEL_FILE) $(DESTDIR)/$(APPNAME)
distclean: clean
$(DEL_FILE) $(DESTDIR)/$(APPNAME)
install: all
#${CP_FILE} $(SRCDIR)/$(APPNAME) $(DESTDIR)/$(APPNAME)
#${CP_FILE} $(DESTDIR)/$(APPNAME) $(ROOTFS_DIR)/home/opencv
May 11, 2016 at 06:13 #8202supportKeymasterThe script you mentioned defines CC as “
arm-poky-linux-gnueabi-gcc
“.Could you try running “which arm-poky-linux-gnueabi-gcc” in the build environment and then checking if there is a
arm-poky-linux-gnueabi-gdb
file in the directory of the gcc binary?May 11, 2016 at 09:05 #8204peter_czParticipantYup, I did ind it arm-poky-linux-gnueabi-gdb but setting up Linux project I got Test Failed:
Tool arguments: -Wl,–start-group “/tmp/VisualGDB_ToolchainTestProgram.o” -o “/tmp/VisualGDB_ToolchainTestProgram” -Wl,-gc-sections -Wl,–end-group
/opt/fsl-imx-x11-new/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crt1.o: No such file or directory
/opt/fsl-imx-x11-new/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crti.o: No such file or directory
/opt/fsl-imx-x11-new/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crtbegin.o: No such file or directory
collect2: error: ld returned 1 exit statusMay 11, 2016 at 09:14 #8205peter_czParticipantI did localize “arm-poky-linux-gnueabi-gdb”.
server host:
/opt/fsl-imx-x11/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi
then I did “New Linux Project” – Build the project under Linux over network and Deploy the project to another Linux computer
Toolchain Test Failed
error messages are in previous post
I do not have files at all : “crt1.o”, “crti.o”, and “crtbegin.o”
-
AuthorPosts
- You must be logged in to reply to this topic.