Yocto-Linux

Sysprogs forums Forums VisualGDB Yocto-Linux

Tagged: ,

Viewing 15 posts - 1 through 15 (of 43 total)
  • Author
    Posts
  • #8058
    peter_cz
    Participant

    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

    #8063
    support
    Keymaster

    Hi,

    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.

    #8064
    peter_cz
    Participant
    #8065
    support
    Keymaster

    Hi,

    Then you should be able to configure VisualGDB similarly to the Edison tutorial. Let us know if you encounter any problems.

    #8185
    peter_cz
    Participant

    Hello,

    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

    #8186
    support
    Keymaster

    Hi,

    We have just published a tutorial on this: http://visualgdb.com/tutorials/linux/3machine/

    Let us know if it leaves any questions unanswered.

    #8187
    peter_cz
    Participant

    I 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 .

     

    #8188
    peter_cz
    Participant

    My 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.

    #8189
    peter_cz
    Participant
    #8193
    support
    Keymaster

    Hi,

    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.

    #8197
    peter_cz
    Participant

    In 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”?

    #8198
    peter_cz
    Participant

    If 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

    #8202
    support
    Keymaster

    The 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?

    #8204
    peter_cz
    Participant

    Yup, 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 status

    #8205
    peter_cz
    Participant

    I 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”

     

Viewing 15 posts - 1 through 15 (of 43 total)
  • You must be logged in to reply to this topic.