yocto: use LDFLAGS if defined in build environment
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Mon, 29 Aug 2016 13:16:13 +0000 (15:16 +0200)
committerDave Thaler <dthaler@microsoft.com>
Tue, 30 Aug 2016 17:13:06 +0000 (17:13 +0000)
Without this change, extra flags like "--hash-style=gnu"
 will be ignored and quality checks will fail.

Reported message is:
  ERROR: iotivity-* do_package_qa: QA Issue:
  No GNU_HASH in the elf binary:
  '*/samples/opt/iotivity/examples/plugins/zigbee/iotivityandzigbeeserver'
  (...)
  ERROR: iotivity-* do_package_qa: QA run found fatal errors. Please consider fixing them.
  ERROR: iotivity-* do_package_qa: Function failed: do_package_qa
  (...)
  Summary: There were 8 ERROR messages shown, returning a non-zero exit code.

Bug: https://lists.yoctoproject.org/pipermail/yocto/2016-August/031442.html
Bug-AGL: https://jira.automotivelinux.org/browse/SPEC-158
Change-Id: Ifa240817c768df3a7d154d36b699de8ca0f0307a
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11073
Reviewed-by: Kishen Maloor <kishen.maloor@intel.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Tested-by: Dave Thaler <dthaler@microsoft.com>
build_common/SConscript

index f8085d4..59a063f 100644 (file)
@@ -1,3 +1,4 @@
+# -*- mode: python; python-indent-offset: 4; indent-tabs-mode: nil -*-
 ##
 # This script includes generic build options:
 #    release/debug, target os, target arch, cross toolchain, build environment etc
@@ -368,6 +369,8 @@ if target_os == "yocto":
                         env[tool] = os.path.join(path, os.environ[tool])
                         break
         env['CROSS_COMPILE'] = target_prefix[:len(target_prefix) - 1]
+        if os.environ['LDFLAGS'] != None:
+            env.AppendUnique(LINKFLAGS = Split(os.environ['LDFLAGS']))
     except:
         print "ERROR in Yocto cross-toolchain environment"
         Exit(1)