Skip to content

use cpu_features to improve compatibility#4004

Merged
ti-chi-bot merged 6 commits into
pingcap:masterfrom
SchrodingerZhu:cpu_features
Feb 11, 2022
Merged

use cpu_features to improve compatibility#4004
ti-chi-bot merged 6 commits into
pingcap:masterfrom
SchrodingerZhu:cpu_features

Conversation

@SchrodingerZhu

Copy link
Copy Markdown
Contributor

Signed-off-by: Schrodinger ZHU Yifan i@zhuyi.fan

What problem does this PR solve?

ld.lld: error: undefined symbol: __cpu_features2
>>> referenced by crc64.cpp:15 (/DATA/disk1/jaysonhuang/tics/libs/libcommon/src/crc64.cpp:15)
>>>               crc64.cpp.o:(crc64::Digest::Digest(crc64::Mode)) in archive libs/libcommon/libcommond.a
>>> referenced by crc64.cpp:25 (/DATA/disk1/jaysonhuang/tics/libs/libcommon/src/crc64.cpp:25)
>>>               crc64.cpp.o:(crc64::Digest::Digest(crc64::Mode)) in archive libs/libcommon/libcommond.a
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)

address issue of gcc_s linkage when __builtin_cpu_supports are used.

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

Signed-off-by: Schrodinger ZHU Yifan <i@zhuyi.fan>
@ti-chi-bot

ti-chi-bot commented Feb 11, 2022

Copy link
Copy Markdown
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 11, 2022
Signed-off-by: Schrodinger ZHU Yifan <i@zhuyi.fan>
@SchrodingerZhu

Copy link
Copy Markdown
Contributor Author

/run-all-tests

Comment thread libs/libcommon/include/common/mem_utils.h Outdated
Signed-off-by: Schrodinger ZHU Yifan <i@zhuyi.fan>
Signed-off-by: Schrodinger ZHU Yifan <i@zhuyi.fan>
@SchrodingerZhu

Copy link
Copy Markdown
Contributor Author

/run-all-tests

Signed-off-by: Schrodinger ZHU Yifan <i@zhuyi.fan>
@SchrodingerZhu SchrodingerZhu changed the title [WIP] use cpu_features to improve compatibility use cpu_features to improve compatibility Feb 11, 2022
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 11, 2022
@SchrodingerZhu

Copy link
Copy Markdown
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 11, 2022
@sre-bot

sre-bot commented Feb 11, 2022

Copy link
Copy Markdown
Collaborator

Coverage for changed files

Filename                                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
dbms/src/Common/TargetSpecific.h                  166               129    22.29%          33                22    33.33%         101                57    43.56%          68                51    25.00%
libs/libcommon/include/common/mem_utils.h         127                66    48.03%           7                 3    57.14%         130                49    62.31%         116                58    50.00%
libs/libcommon/src/crc64.cpp                       33                 7    78.79%           4                 2    50.00%          51                19    62.75%          26                 9    65.38%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                             326               202    38.04%          44                27    38.64%         282               125    55.67%         210               118    43.81%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16384      9726             40.64%    179889  98644        45.16%

full coverage report (for internal network access only)

@SchrodingerZhu

Copy link
Copy Markdown
Contributor Author

/merge

@ti-chi-bot

Copy link
Copy Markdown
Member

@SchrodingerZhu: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot

Copy link
Copy Markdown
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: 47ebeb8

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 11, 2022
@sre-bot

sre-bot commented Feb 11, 2022

Copy link
Copy Markdown
Collaborator

Coverage for changed files

Filename                                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
dbms/src/Common/TargetSpecific.h                  166               129    22.29%          33                22    33.33%         101                57    43.56%          68                51    25.00%
libs/libcommon/include/common/mem_utils.h         127                66    48.03%           7                 3    57.14%         130                49    62.31%         116                58    50.00%
libs/libcommon/src/crc64.cpp                       33                 7    78.79%           4                 2    50.00%          51                19    62.75%          26                 9    65.38%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                             326               202    38.04%          44                27    38.64%         282               125    55.67%         210               118    43.81%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16384      9725             40.64%    179889  98638        45.17%

full coverage report (for internal network access only)

@ti-chi-bot
ti-chi-bot merged commit 529a34f into pingcap:master Feb 11, 2022
@jiaqizho

Copy link
Copy Markdown
Contributor
Undefined symbols for architecture arm64:
  "_GetAarch64FeaturesEnumName", referenced from:
      _main in list_cpu_features.c.o
  "_GetAarch64FeaturesEnumValue", referenced from:
      _main in list_cpu_features.c.o
  "_GetAarch64Info", referenced from:
      _main in list_cpu_features.c.o

will get this error in the m1 build.

And fix patch in origin repo: Fix the build for M1 MacBooks #211

@JaySon-Huang
JaySon-Huang deleted the cpu_features branch February 18, 2022 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants