Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config/functions: add C++ compiler and linker flags to meson.conf #3468

Merged
merged 1 commit into from
May 4, 2019

Conversation

HiassofT
Copy link
Member

@HiassofT HiassofT commented Apr 29, 2019

Due to missing cpp_args and cpp_link_args in meson.conf ninja builds
of projects with C++ code were performed without CPU optimization
flags (-march, -mcpu, -mtune etc). Add these args so C++ code is
built with proper flags.

Due to missing cpp_args and cpp_link_args in meson.conf ninja builds
of projects with C++ code were performed without CPU optimization
flags (-march, -mcpu, -mtune etc). Add these args so C++ code is
built with proper flags.

Signed-off-by: Matthias Reichl <hias@horus.com>
@@ -386,6 +386,8 @@ endian = '$endian'
root = '$root'
$(python -c "import os; print('c_args = {}'.format([x for x in os.getenv('CFLAGS').split()]))")
$(python -c "import os; print('c_link_args = {}'.format([x for x in os.getenv('LDFLAGS').split()]))")
$(python -c "import os; print('cpp_args = {}'.format([x for x in os.getenv('CXXFLAGS').split()]))")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mixing cpp and cxx looks wrong.
should it more like 'cpp_args -> CPPFLAGS' and 'cxx_args -> CXXFLAGS' ?

Copy link
Member

@InuSasha InuSasha Apr 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh holy...
you are right: meson uses cpp_args for c++. really confusing
https://mesonbuild.com/Builtin-options.html#compiler-options

@kszaq
Copy link
Contributor

kszaq commented Apr 30, 2019

Tested with mesa panfrost + lima on Amlogic mainline: compiles, works and a nice 1.2MB save on dri libraries! 👍

@MilhouseVH
Copy link
Contributor

This PR results in a nice reduction on Generic (#0430 without PR, #0501 with PR):

SIZE CHANGE    Delta: -1,560,864   #0501: 8,361,192     #0430: 9,922,056    /usr/lib/dri/r300_dri.so
SIZE CHANGE    Delta: -1,560,864   #0501: 8,361,192     #0430: 9,922,056    /usr/lib/dri/r600_dri.so
SIZE CHANGE    Delta: -1,560,864   #0501: 8,361,192     #0430: 9,922,056    /usr/lib/dri/radeonsi_dri.so
SIZE CHANGE    Delta: -1,560,864   #0501: 8,361,192     #0430: 9,922,056    /usr/lib/dri/virtio_gpu_dri.so
SIZE CHANGE    Delta: -1,560,864   #0501: 8,361,192     #0430: 9,922,056    /usr/lib/dri/vmwgfx_dri.so
SIZE CHANGE    Delta: -1,199,880   #0501: 8,052,240     #0430: 9,252,120    /usr/lib/dri/i915_dri.so
SIZE CHANGE    Delta: -1,199,880   #0501: 8,052,240     #0430: 9,252,120    /usr/lib/dri/i965_dri.so
SIZE CHANGE    Delta: -635,016     #0501: 4,222,056     #0430: 4,857,072    /usr/lib/vdpau/libvdpau_r300.so.1.0.0
SIZE CHANGE    Delta: -635,016     #0501: 4,222,056     #0430: 4,857,072    /usr/lib/vdpau/libvdpau_r600.so.1.0.0
SIZE CHANGE    Delta: -635,016     #0501: 4,222,056     #0430: 4,857,072    /usr/lib/vdpau/libvdpau_radeonsi.so.1.0.0
SIZE CHANGE    Delta: -627,000     #0501: 3,527,064     #0430: 4,154,064    /usr/lib/dri/r600_drv_video.so
SIZE CHANGE    Delta: -627,000     #0501: 3,527,064     #0430: 4,154,064    /usr/lib/dri/radeonsi_drv_video.so
SIZE CHANGE    Delta: -16,160      #0501: 1,602,376     #0430: 1,618,536    /usr/lib/libxatracker.so.2.5.0
SIZE CHANGE    Delta: 8            #0501: 272           #0430: 264          /etc/issue
SIZE CHANGE    Delta: 24           #0501: 514           #0430: 490          /etc/os-release
SIZE CHANGE    Delta: 64           #0501: 22,043,296    #0430: 22,043,232   /usr/lib/nvidia/nvidia.ko
TOTAL CHANGE   Delta: -13,379,192 (less) in #0501 (kernel 5.0.10) compared with #0430 (kernel 5.0.10) [minimum delta: 0, files below threshhold: 0]

SYSTEM         Delta: -770,048     #0501: 246,013,952   #0430: 246,784,000  (less in #0501)
KERNEL         Delta: 0            #0501: 16,445,824    #0430: 16,445,824   (more in #0501)

@MilhouseVH MilhouseVH merged commit 1a604c6 into LibreELEC:master May 4, 2019
@HiassofT HiassofT deleted the le10-meson-cpp branch January 16, 2021 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants