1. 04 May, 2018 1 commit
    • Jiri Slaby's avatar
      tools: power/acpi, revert to LD = gcc · 75539616
      Jiri Slaby authored
      Commit 7ed1c190 (tools: fix cross-compile var clobbering) removed
      setting of LD to $(CROSS_COMPILE)gcc. This broke build of acpica
      (acpidump) in power/acpi:
       ld: unrecognized option '-D_LINUX'
      
      The tools pass CFLAGS to the linker (incl. -D_LINUX), so revert this
      particular change and let LD be $(CC) again. Note that the old behaviour
      was a bit different, it used $(CROSS_COMPILE)gcc which was eliminated by
      the commit 7ed1c190. We use $(CC) for that reason.
      
      Fixes: 7ed1c190 (tools: fix cross-compile var clobbering)
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: 4.16+ <stable@vger.kernel.org> # 4.16+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      75539616
  2. 21 Feb, 2018 1 commit
    • Martin Kelly's avatar
      tools: fix cross-compile var clobbering · 7ed1c190
      Martin Kelly authored
      Currently a number of Makefiles break when used with toolchains that
      pass extra flags in CC and other cross-compile related variables (such
      as --sysroot).
      
      Thus we get this error when we use a toolchain that puts --sysroot in
      the CC var:
      
        ~/src/linux/tools$ make iio
        [snip]
        iio_event_monitor.c:18:10: fatal error: unistd.h: No such file or directory
          #include <unistd.h>
                   ^~~~~~~~~~
      
      This occurs because we clobber several env vars related to
      cross-compiling with lines like this:
      
        CC = $(CROSS_COMPILE)gcc
      
      Although this will point to a valid cross-compiler, we lose any extra
      flags that might exist in the CC variable, which can break toolchains
      that rely on them (for example, those that use --sysroot).
      
      This easily shows up using a Yocto SDK:
      
        $ . [snip]/sdk/environment-setup-cortexa8hf-neon-poky-linux-gnueabi
      
        $ echo $CC
        arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard
        -mcpu=cortex-a8
        --sysroot=[snip]/sdk/sysroots/cortexa8hf-neon-poky-linux-gnueabi
      
        $ echo $CROSS_COMPILE
        arm-poky-linux-gnueabi-
      
        $ echo ${CROSS_COMPILE}gcc
        krm-poky-linux-gnueabi-gcc
      
      Although arm-poky-linux-gnueabi-gcc is a cross-compiler, we've lost the
      --sysroot and other flags that enable us to find the right libraries to
      link against, so we can't find unistd.h and other libraries and headers.
      Normally with the --sysroot flag we would find unistd.h in the sdk
      directory in the sysroot:
      
        $ find [snip]/sdk/sysroots -path '*/usr/include/unistd.h'
        [snip]/sdk/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/include/unistd.h
      
      The perf Makefile adds CC = $(CROSS_COMPILE)gcc if and only if CC is not
      already set, and it compiles correctly with the above toolchain.
      
      So, generalize the logic that perf uses in the common Makefile and
      remove the manual CC = $(CROSS_COMPILE)gcc lines from each Makefile.
      
      Note that this patch does not fix cross-compile for all the tools (some
      have other bugs), but it does fix it for all except usb and acpi, which
      still have other unrelated issues.
      
      I tested both with and without the patch on native and cross-build and
      there appear to be no regressions.
      
      Link: http://lkml.kernel.org/r/20180107214028.23771-1-martin@martingkelly.comSigned-off-by: default avatarMartin Kelly <martin@martingkelly.com>
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: Pali Rohar <pali.rohar@gmail.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Robert Moore <robert.moore@intel.com>
      Cc: Lv Zheng <lv.zheng@intel.com>
      Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Valentina Manea <valentina.manea.m@gmail.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Mario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7ed1c190
  3. 16 Nov, 2016 1 commit
  4. 23 Jun, 2016 1 commit
  5. 31 Jul, 2015 1 commit
  6. 08 Jul, 2014 3 commits
    • Lv Zheng's avatar
      ACPICA: Common: Enhance cm_get_file_size() to improve portability · 3c9349c9
      Lv Zheng authored
      This patch uses abstract file IO and acpi_log_error() APIs to enhance
      cm_get_file_size() so that applications that invoke this API could have
      portability improved.
      
      With actual references added to abstract file IO and acpi_log_error(), the
      applications need to link oslibcfs.o, utdebug.o, utexcep.o, utmath.o,
      utprint.o and utxferror.o.
      
      It is also required to add acpi_os_initialize() invocations if an
      application starts to use acpi_log_error().
      
      acpidump has already invoked acpi_os_initialize() in this way.  Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3c9349c9
    • Lv Zheng's avatar
      ACPICA: OSL: Clean up acpi_os_printf()/acpi_os_vprintf() stubs · 83b80bac
      Lv Zheng authored
      This patch is mainly for acpidump where there are redundant
      acpi_os_printf()/acpi_os_vprintf() stubs implemented. This patch cleans up such
      specific implementation by linking acpidump to osunixxf.c/oswinxf.c.
      
      To make acpi_os_printf() exported by osunixxf.c/oswinxf.c to behave as the
      old acpidump specific ones, applications need to:
       1. Initialize acpi_gbl_db_output_flags to ACPI_DB_CONSOLE_OUTPUT.
          This is automatically done by ACPI_INIT_GLOBAL(), applications need to
          link utglobal.o to utilize this mechanism.
       2. Initialize acpi_gbl_output_file to stdout.
          For GCC, assigning stdout to acpi_gbl_output_file using ACPI_INIT_GLOBAL()
          is not possible as stdout is not a constant in GCC environment. As an
          alternative solution, stdout assignment is put into acpi_os_initialize().
          Thus acpi_os_initialize() need to be invoked very early by the
          applications to initialize the default output of acpi_os_printf().
      
      This patch also releases osunixxf.c to the Linux kernel. Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      83b80bac
    • Lv Zheng's avatar
      ACPICA: Utilities: Cleanup DEFINE_ACPI_GLOBALS by moving acpi_ut_init_global()... · e8c038a3
      Lv Zheng authored
      ACPICA: Utilities: Cleanup DEFINE_ACPI_GLOBALS by moving acpi_ut_init_global() from utglobal.c to utinit.c
      
      The utglobal.c is used to define and initialize global variables.  It makes
      sense if just adding utglobal.o to applications that are using such
      variables. But acpi_ut_init_globals() is preventing us from doing so as
      this initialization function references other components' initializations
      code, which leads to the requirement that many files should also get linked
      if one wants to link utglobal.o.
      
      It is possible to just move acpi_ut_init_global() to utinit.c for
      applications that require this function to link.
      
      By linking utglobal.o, we can stop defining DEFINE_ACPI_GLOBALS for
      applications (currently only acpidump is affected). Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e8c038a3
  7. 28 Apr, 2014 1 commit
  8. 21 Apr, 2014 1 commit
  9. 20 Apr, 2014 1 commit
    • Lv Zheng's avatar
      ACPICA: acpidump: Update Makefile to build acpidump from ACPICA. · edbe47c1
      Lv Zheng authored
      This patch updates tools Makefile to use new acpidump.
      
      ACPICA's acpidump relies on various ACPICA components/common/os_specific
      source code.  They are located in various kernel folders, being searched
      and compiled using vpath technique in Makefile.  These files include:
      1. drivers/acpi/acpica/acapps.h
      2. tools/power/acpi/common/getopt.c
      3. tools/power/acpi/common/cmfsize.c
      4. tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
      5. tools/power/acpi/os_specific/service_layers/osunixdir.c
      6. tools/power/acpi/os_specific/service_layers/osunixmap.c
      
      This patch has been tested on DELL Inspiron Mini, acpidump output can be
      successfully generated by typing the following commands:
      # cd tools/power/acpi
      # make DEBUG=false
      # sudo make install DESTDIR=/opt
      # sudo make uninstall DESTDIR=/opt
      # make clean
      Or
      # cd tools
      # make acpi
      # sudo make acpi_install
      # sudo make acpi_uninstall
      # make acpi_clean
      A kernel build test is also performed on DELL Inspiron Mini to verify that
      the changes done to actypes.h and aclinux.h won't affect the kernel
      build process.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      [rjw: Subject]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      edbe47c1
  10. 16 Jan, 2014 1 commit
    • Lv Zheng's avatar
      ACPICA: acpidump: Cleanup tools/power/acpi makefiles. · f677b30b
      Lv Zheng authored
      This patch cleans up old tools/power/acpi Makefile for further porting,
      make it compiled in a similar way as the other tools.  No functional
      changes.
      
      The CFLAGS is modified as follows:
      1. Previous cc flags:
         -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Os -s \
         -D_LINUX -DDEFINE_ALTERNATE_TYPES -I../../../include
      2. Current cc flags:
         DEBUG=false:
         -D_LINUX -DDEFINE_ALTERNATE_TYPES -I../../../include -Wall \
         -Wstrict-prototypes -Wdeclaration-after-statement -Os \
         -fomit-frame-pointer
         Normal:
         -D_LINUX -DDEFINE_ALTERNATE_TYPES -I../../../include -Wall \
         -Wstrict-prototypes -Wdeclaration-after-statement -O1 -g -DDEBUG
      
      There is only one difference: -fomit-frame-pointer.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f677b30b
  11. 05 Feb, 2013 1 commit
  12. 25 Sep, 2012 1 commit
  13. 23 Sep, 2012 3 commits