Coder Social home page Coder Social logo

Ninja build error about docs HOT 10 CLOSED

openbmc avatar openbmc commented on May 29, 2024
Ninja build error

from docs.

Comments (10)

williamspatrick avatar williamspatrick commented on May 29, 2024 2

Seems like some files were built but some weren't?

../bmc_state_manager_main.cpp: In function ‘int main(int, char**)’:
../bmc_state_manager_main.cpp:9:14: error: unused parameter ‘argc’ [-Werror=unused-parameter]
    9 | int main(int argc, char**)
      |          ~~~~^~~~
cc1plus: all warnings being treated as errors

Unless you fixed this, then the phosphor-bmc-state-manager seemed to fail. Should be a pretty straight-forward fix for you...

from docs.

williamspatrick avatar williamspatrick commented on May 29, 2024

None of those look like warnings. Is there more to the build log?

Please upload text to a service like gist.github.com (or paste here) rather than attempting to take screenshots.

from docs.

hayleyyan avatar hayleyyan commented on May 29, 2024

Here's the full output when i run ninja -C build
https://gist.github.com/hayleyyan/4f352a884c4cc45eeee1afb0f4b4da04

from docs.

williamspatrick avatar williamspatrick commented on May 29, 2024

It seems like the only warning is this:

/root/sdk/romulus-2022-06-06/sysroots/arm1176jzs-openbmc-linux-gnueabi/usr/include/features.h:412:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
  412 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~

I'm not sure why that is present since it appears that the compiler call includes -O2:
arm-openbmc-linux-gnueabi-g++ -marm -mcpu=arm1176jz-s -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/root/sdk/romulus-2022-06-06/sysroots/arm1176jzs-openbmc-linux-gnueabi -Iphosphor-hypervisor-state-manager.p -I. -I.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -Werror -std=c++20 -O0 -g -DENABLE_WARM_REBOOT -DBOOST_ASIO_DISABLE_THREADS -DBOOST_ALL_NO_LIB -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_COROUTINES_NO_DEPRECATION_WARNING -MD -MQ phosphor-hypervisor-state-manager.p/hypervisor_state_manager_main.cpp.o -MF phosphor-hypervisor-state-manager.p/hypervisor_state_manager_main.cpp.o.d -o phosphor-hypervisor-state-manager.p/hypervisor_state_manager_main.cpp.o -c ../hypervisor_state_manager_main.cpp

@geissonator Any ideas on this? I don't see anything obviously wrong from the phosphor-state-manager's meson.build.

@hayleyyan In the short term you could probably get rid of these two lines in the meson.build:

        'warning_level=3',
        'werror=true',

https://github.com/openbmc/phosphor-state-manager/blob/master/meson.build#L5

from docs.

williamspatrick avatar williamspatrick commented on May 29, 2024

Oh... There is a -O2 and then later there is a -O0. Any ideas where the -O0 is coming from? Have you set any CFLAGS or CXXFLAGS environment variables? Can you also check if the SDK set any of them?

from docs.

hayleyyan avatar hayleyyan commented on May 29, 2024

I didn't set any of those environment variables but it seems the SDK have set them to the following:

echo $CFLAGS
-O2 -pipe -g -feliminate-unused-debug-types

echo $CXXFLAGS
-O2 -pipe -g -feliminate-unused-debug-types

from docs.

manojkiraneda avatar manojkiraneda commented on May 29, 2024

@hayleyyan which build type are u trying to build ? wonder if it is coming due to meson's default build debug which comes with -O0

As phosphor-state-manager does not implicitly defaulted the build type to debugoptimized(comes with -O2) , it might be taking the meson's default build type debug (comes with -O0), but the SDK what you would have sourced in implicitly would have added an -O2 in the CXXFLAGS environmental variable which is why you probably see both optimization's in the build log.

Can you try building with meson build -Dbuildtype=debugoptimized to see if the error goes away ?

from docs.

hayleyyan avatar hayleyyan commented on May 29, 2024

@manikandan-e i'm building on romulus. Here's the output with meson build -Dbuildtype=debugoptimized

https://gist.github.com/hayleyyan/8778ba844a9e7e789f01f3dab5df4f0a

from docs.

williamspatrick avatar williamspatrick commented on May 29, 2024

@manikandan-e i'm building on romulus. Here's the output with meson build -Dbuildtype=debugoptimized

https://gist.github.com/hayleyyan/8778ba844a9e7e789f01f3dab5df4f0a

Seems good now... There is just a warning about an unused variable.

from docs.

hayleyyan avatar hayleyyan commented on May 29, 2024

When i'm trying to do the next command in Load the Application Into QEMU, it's returning the following:

root@hayley-VirtualBox:/home/hayley/repo/phosphor-state-manager/build# arm-openbmc-linux-gnueabi-strip phosphor-bmc-state-manager
arm-openbmc-linux-gnueabi-strip: 'phosphor-bmc-state-manager': No such file

Here's all the files I have under build:

build.ninja                            phosphor-chassis-state-manager.p      phosphor-secure-boot-check.p
compile_commands.json                  phosphor-discover-system-state        phosphor-systemd-target-monitor
config.h                               phosphor-discover-system-state.p      phosphor-systemd-target-monitor.p
data                                   phosphor-host-reset-recovery          service_files
meson-info                             phosphor-host-reset-recovery.p        target_files
meson-logs                             phosphor-host-state-manager           test_hypervisor_state.p
meson-private                          phosphor-host-state-manager.p         test_scheduled_host_transition.p
phosphor-bmc-state-manager.p           phosphor-hypervisor-state-manager     test_systemd_parser.p
phosphor-chassis-check-power-status    phosphor-hypervisor-state-manager.p   test_systemd_signal.p
phosphor-chassis-check-power-status.p  phosphor-scheduled-host-transition
phosphor-chassis-state-manager         phosphor-scheduled-host-transition.p

Seems like some files were built but some weren't?

from docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.