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

libz link error while building fizz #40

Closed
spothineni opened this issue Sep 13, 2019 · 1 comment
Closed

libz link error while building fizz #40

spothineni opened this issue Sep 13, 2019 · 1 comment

Comments

@spothineni
Copy link

spothineni commented Sep 13, 2019

[ 0%] Building CXX object CMakeFiles/fizz.dir/record/EncryptedRecordLayer.cpp.o
[ 1%] Building CXX object CMakeFiles/fizz.dir/record/PlaintextRecordLayer.cpp.o
[ 1%] Building CXX object CMakeFiles/fizz.dir/server/ServerProtocol.cpp.o
[ 2%] Building CXX object CMakeFiles/fizz.dir/server/CertManager.cpp.o
[ 2%] Building CXX object CMakeFiles/fizz.dir/server/State.cpp.o
[ 3%] Building CXX object CMakeFiles/fizz.dir/server/FizzServer.cpp.o
[ 3%] Building CXX object CMakeFiles/fizz.dir/server/TicketCodec.cpp.o
[ 4%] Building CXX object CMakeFiles/fizz.dir/server/CookieCipher.cpp.o
[ 4%] Building CXX object CMakeFiles/fizz.dir/server/ReplayCache.cpp.o
[ 5%] Building CXX object CMakeFiles/fizz.dir/server/SlidingBloomReplayCache.cpp.o
[ 5%] Building CXX object CMakeFiles/fizz.dir/protocol/AsyncFizzBase.cpp.o
[ 6%] Building CXX object CMakeFiles/fizz.dir/protocol/Types.cpp.o
[ 6%] Building CXX object CMakeFiles/fizz.dir/protocol/Exporter.cpp.o
[ 7%] Building CXX object CMakeFiles/fizz.dir/protocol/DefaultCertificateVerifier.cpp.o
[ 7%] Building CXX object CMakeFiles/fizz.dir/protocol/Events.cpp.o
[ 8%] Building CXX object CMakeFiles/fizz.dir/protocol/KeyScheduler.cpp.o
[ 8%] Building CXX object CMakeFiles/fizz.dir/protocol/Certificate.cpp.o
[ 9%] Building CXX object CMakeFiles/fizz.dir/protocol/CertDecompressionManager.cpp.o
[ 9%] Building CXX object CMakeFiles/fizz.dir/protocol/ZlibCertificateCompressor.cpp.o
[ 10%] Building CXX object CMakeFiles/fizz.dir/protocol/ZlibCertificateDecompressor.cpp.o
[ 10%] Building CXX object CMakeFiles/fizz.dir/protocol/clock/SystemClock.cpp.o
[ 11%] Building CXX object CMakeFiles/fizz.dir/extensions/exportedauth/ExportedAuthenticator.cpp.o
[ 11%] Building CXX object CMakeFiles/fizz.dir/extensions/tokenbinding/Types.cpp.o
[ 12%] Building CXX object CMakeFiles/fizz.dir/extensions/tokenbinding/TokenBindingConstructor.cpp.o
[ 12%] Building CXX object CMakeFiles/fizz.dir/extensions/tokenbinding/TokenBindingClientExtension.cpp.o
[ 13%] Building CXX object CMakeFiles/fizz.dir/extensions/tokenbinding/Validator.cpp.o
[ 13%] Building CXX object CMakeFiles/fizz.dir/client/State.cpp.o
[ 14%] Building CXX object CMakeFiles/fizz.dir/client/ClientProtocol.cpp.o
[ 14%] Building CXX object CMakeFiles/fizz.dir/client/SynchronizedLruPskCache.cpp.o
[ 15%] Building CXX object CMakeFiles/fizz.dir/client/EarlyDataRejectionPolicy.cpp.o
[ 15%] Building CXX object CMakeFiles/fizz.dir/util/FizzUtil.cpp.o
[ 16%] Linking CXX static library lib/libfizz.a
[ 21%] Built target fizz
Scanning dependencies of target BogoShim
[ 22%] Building CXX object CMakeFiles/BogoShim.dir/test/BogoShim.cpp.o
[ 22%] Linking CXX executable bin/BogoShim
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /home/spothineni/Sudhir/hbase-native-client/thirdparty/folly/usr/local/lib/libfolly.a(Zlib.cpp.o): undefined reference to symbol 'inflateInit2_'
//lib64/libz.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/BogoShim.dir/build.make:102: bin/BogoShim] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/BogoShim.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Its getting series of linker errors start with libz, gflags, lz4, what si the correct way of building folly and link it to fizz?

@z6833
Copy link

z6833 commented Dec 6, 2019

I`ve got the same problem . Is there any solution?Could anyone help me ?

facebook-github-bot pushed a commit that referenced this issue Jun 6, 2024
Summary:
The `VLOG(8)` is not enabled anywhere (it looks like this was mainly for
debugging purposes during development) and this adds a non-trivial amount of
generated code. Each instantiation is distinct since the logging string is
dependent on the NTTP. The VLOG macro itself generates a decent amount of code
to check whether or not the logging level is enabled.

Additionally, downgrade the `CHECK` to a `DCHECK` -- we don't ever expect this
to be hit; the state machine implementations always use an unqualified access
to `Transition` (i.e. nobody ever explicitly writes `EventHandlerBase<SM, SomeOtherState, SomeOtherEvent>::Transition`, which means that the correct state is guaranteed. This also eliminates the
runtime check overhead.

Prior to this diff:
```
0000000000034ac4 <_ZN4fizz2sm16EventHandlerBaseINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE3EJLS4_1EEE10TransitionILS4_1EEEvRNS2_5StateE>:
   34ac4:       d10103ff        sub     sp, sp, #0x40
   34ac8:       a90257fe        stp     x30, x21, [sp, #32]
   34acc:       a9034ff4        stp     x20, x19, [sp, #48]
   34ad0:       d53bd054        mrs     x20, tpidr_el0
   34ad4:       52800035        mov     w21, #0x1                       // #1
   34ad8:       f0fffea2        adrp    x2, b000 <note_end+0xad30>
   34adc:       911ea042        add     x2, x2, #0x7a8
   34ae0:       f9401688        ldr     x8, [x20, #40]
   34ae4:       910003e1        mov     x1, sp
   34ae8:       aa0003f3        mov     x19, x0
   34aec:       f9000fe8        str     x8, [sp, #24]
   34af0:       b90003f5        str     w21, [sp]
   34af4:       94003d92        bl      4413c <_ZN6google12Check_EQImplIN4fizz6client9StateEnumES3_EEPNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERKT_RKT0_PKc>
   34af8:       f9000be0        str     x0, [sp, #16]
   34afc:       b5000140        cbnz    x0, 34b24 <_ZN4fizz2sm16EventHandlerBaseINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE3EJLS4_1EEE10TransitionILS4_1EEEvRNS2_5StateE+0x60>
   34b00:       b9000275        str     w21, [x19]
   34b04:       f9401688        ldr     x8, [x20, #40]
   34b08:       f9400fe9        ldr     x9, [sp, #24]
   34b0c:       eb09011f        cmp     x8, x9
   34b10:       540001c1        b.ne    34b48 <_ZN4fizz2sm16EventHandlerBaseINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE3EJLS4_1EEE10TransitionILS4_1EEEvRNS2_5StateE+0x84>  // b.any
   34b14:       a9434ff4        ldp     x20, x19, [sp, #48]
   34b18:       a94257fe        ldp     x30, x21, [sp, #32]
   34b1c:       910103ff        add     sp, sp, #0x40
   34b20:       d65f03c0        ret
   34b24:       f0fffea1        adrp    x1, b000 <note_end+0xad30>
   34b28:       9114e821        add     x1, x1, #0x53a
   34b2c:       910003e0        mov     x0, sp
   34b30:       910043e3        add     x3, sp, #0x10
   34b34:       52800502        mov     w2, #0x28                       // #40
   34b38:       940084bb        bl      55e24 <_ZN6google15LogMessageFatalC1EPKciRKNS_13CheckOpStringE>
   34b3c:       910003e0        mov     x0, sp
   34b40:       940080a1        bl      54dc4 <_ZN6google10LogMessage6streamEv>
   34b44:       14000002        b       34b4c <_ZN4fizz2sm16EventHandlerBaseINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE3EJLS4_1EEE10TransitionILS4_1EEEvRNS2_5StateE+0x88>
   34b48:       94008c82        bl      57d50 <__stack_chk_fail@plt>
   34b4c:       910003e0        mov     x0, sp
   34b50:       940084b6        bl      55e28 <_ZN6google15LogMessageFatalD1Ev>
```

After this diff:

```
00000000000347e8 <_ZN4fizz2sm16EventHandlerBaseINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE3EJLS4_1EEE10TransitionILS4_1EEEvRNS2_5StateE>:
   347e8:       52800028        mov     w8, #0x1                        // #1
   347ec:       b9000008        str     w8, [x0]
   347f0:       d65f03c0        ret
```

Reviewed By: abakiaydin

Differential Revision: D58162021

fbshipit-source-id: e223ac9902b3c6817ee4e5962292b20bd95c40f7
facebook-github-bot pushed a commit that referenced this issue Jun 6, 2024
…rence

Summary:
Prior to this diff, the `EarlyAppWrite` was taken in by value, which meant that
there were 6 unique event handlers that needed to perform the allocate
stack/move/call/cleanup/exception handling for each call to `handleAppWrite` or
`ignoreEarlyAppWrite`.

This diff changes the signature to take the parameter by reference. This means
that w.r.t the caller, there are no locally scoped variables with non-trivial
destructors, so that the EventHandlers can simply tail call into the function.

Before:
```
0000000000039774 <_ZN4fizz2sm12EventHandlerINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE16EE6handleERKNS2_5StateERNS_5ParamE>:
   39774:       d10143ff        sub     sp, sp, #0x50
   39778:       f9001bfe        str     x30, [sp, #48]
   3977c:       a9044ff4        stp     x20, x19, [sp, #64]
   39780:       d53bd053        mrs     x19, tpidr_el0
   39784:       910003f4        mov     x20, sp
   39788:       f9401669        ldr     x9, [x19, #40]
   3978c:       f90017e9        str     x9, [sp, #40]
   39790:       b9412029        ldr     w9, [x1, #288]
   39794:       71004d3f        cmp     w9, #0x13
   39798:       9a9f0029        csel    x9, x1, xzr, eq  // eq = none
   3979c:       3dc00120        ldr     q0, [x9]
   397a0:       f900053f        str     xzr, [x9, #8]
   397a4:       f940092a        ldr     x10, [x9, #16]
   397a8:       b9401929        ldr     w9, [x9, #24]
   397ac:       3d8003e0        str     q0, [sp]
   397b0:       f9000bea        str     x10, [sp, #16]
   397b4:       b9001be9        str     w9, [sp, #24]
   397b8:       910003e1        mov     x1, sp
   397bc:       94000011        bl      39800 <_ZN4fizz2smL19handleEarlyAppWriteERKNS_6client5StateENS_13EarlyAppWriteE>
   397c0:       b27d0280        orr     x0, x20, #0x8
   397c4:       97ffb75a        bl      2752c <_ZNSt6__ndk110unique_ptrIN5folly5IOBufENS_14default_deleteIS2_EEED2Ev>
   397c8:       f9401668        ldr     x8, [x19, #40]
   397cc:       f94017e9        ldr     x9, [sp, #40]
   397d0:       eb09011f        cmp     x8, x9
   397d4:       540000a1        b.ne    397e8 <_ZN4fizz2sm12EventHandlerINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE16EE6handleERKNS2_5StateERNS_5ParamE+0x74>  // b.any
   397d8:       a9444ff4        ldp     x20, x19, [sp, #64]
   397dc:       f9401bfe        ldr     x30, [sp, #48]
   397e0:       910143ff        add     sp, sp, #0x50
   397e4:       d65f03c0        ret
   397e8:       9400770e        bl      57420 <__stack_chk_fail@plt>
   397ec:       aa0003f3        mov     x19, x0
   397f0:       b27d0280        orr     x0, x20, #0x8
   397f4:       97ffb74e        bl      2752c <_ZNSt6__ndk110unique_ptrIN5folly5IOBufENS_14default_deleteIS2_EEED2Ev>
   397f8:       aa1303e0        mov     x0, x19
   397fc:       940078d1        bl      57b40 <__wrap__Unwind_Resume@plt>

```

After:
```
0000000000039714 <_ZN4fizz2sm12EventHandlerINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE16EE6handleERKNS2_5StateERNS_5ParamE>:
   39714:       14000001        b       39718 <_ZN4fizz2smL19handleEarlyAppWriteERKNS_6client5StateERNS_5ParamE>
```

Reviewed By: zalecodez

Differential Revision: D58164235

fbshipit-source-id: 9d06f5bf7f1a2c931131597f53ef6c3cd734fe46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants