Page MenuHomeFreeBSD

multimedia/x264: Add optimization and some minor clean-ups
Needs ReviewPublic

Authored by daniel.engberg.lists_pyret.net on Jul 22 2019, 8:03 AM.

Details

Reviewers
koobs
jbeich
Summary

Enable Link-Time Optimization and OPTIMIZED_CFLAGS on aarch64, armv7 and amd64
Remove unneeded CONFIGURE_ARGS, it already picks up CFLAGS, CPPFLAGS and LDFLAGS
Strip -O2 when enabling OPTIMIZED_CFLAGS to avoid setting multiple -O FLAGS

Test Plan

Compile and Run-time tested on:
aarch64, Orange Pi PC2, 13.0-CURRENT
armv7, Orange Pi PC, 13.0-CURRENT
amd64, Dell T20 (Intel i7-3770), 13.0-CURRENT

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

koobs added a comment.Jul 23 2019, 4:50 AM

Looks OK. Questions:

  1. Does libx264 still pass QA (poudriere: build, link, stage, package) with the --extra_*flags removals?
  2. What are the optimized cflags? I see no build changes (other than -02 removal) when the option is enabled?

Hi,

Unfortunately I don't have a pouderie setup ready mainly because of lack of proper (fast) hardware but I'll give it a try although it might take a while (probably one or two weeks).
Just to make sure, you're referring to this? https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/testing-poudriere.html

I used OPTIMIZED_CLAGS as a toggle as (lib)x264 sets -O3 by default but is overridden by toolchain CFLAGS and from what I can tell it seems like a good choice of name looking at other ports but perhaps there's a better one?

Disabled

cc -Wshadow -O3 -ffast-math -m64 -O2 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -Wall -I. -I. -std=gnu99 -D_GNU_SOURCE -mstack-alignment=64 -fPIC -fomit-frame-pointer -flto -fno-tree-vectorize -c common/osdep.c -o common/osdep.o

Enabled

cc -Wshadow -O3 -ffast-math -m64 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -Wall -I. -I. -std=gnu99 -D_GNU_SOURCE -mstack-alignment=64 -fPIC -fomit-frame-pointer -flto -fno-tree-vectorize -c common/osdep.c -o common/osdep.o

No poudriere build yet but make stage && make check-plist && make stage-qa && make package completes without any errors

Poudriere run