Comments (7)
You mention "normal" a lot - unfortunately OpenSSL is not normal!
The helper functions are defined that way in OpenSSL, as static inline functions. Macros could in theory be used instead, but then you'd lose all the type checking and tracing, which would make debugging difficult. Unfortunately, VBCC does not have an "inline" keyword for forcing functions to be inlined, unlike GCC (and SAS/C incidentally), so I guess -O3 is your only option there.
As these inline functions simply call OpenSSL functions, AmiSSLBase has to be a global variable - I don't see a way around that.
One alternative to inline functions would be to create a link library instead, but still this approach would require AmiSSLBase to be a global variable too, if those functions are used.
from amissl.
BTW, I guess you could try the following, if you do not need those helper functions:
#define AMISSL_INLINE_H
#include <proto/amissl.h>
Everything in amissl/inline.h
is actually a copy of the corresponding code from openssl/safestack.h
and openssl/lhash.h
, so that's where those inline functions originate in OpenSSL.
from amissl.
Thank you very much - when AMISSL_INLINE_H is defined, none of the issues mentioned above appear when including proto/amissl.h:
$ make EmptyAmiSSLTest EmptyAmiSSLTest_O3 LocalBaseAmiSSLTest
vc +aos68k -nostdlib -c99 -O2 -lvc -DAMISSL_INLINE_H -IAmiSSL/Developer/include -o EmptyAmiSSLTest EmptyAmiSSLTest.c
vc +aos68k -nostdlib -c99 -O3 -lvc -DAMISSL_INLINE_H -IAmiSSL/Developer/include -o EmptyAmiSSLTest_O3 EmptyAmiSSLTest.c
vc +aos68k -nostdlib -c99 -O2 -lvc -DAMISSL_INLINE_H -D__NOLIBBASE__ -IAmiSSL/Developer/include -o LocalBaseAmiSSLTest LocalBaseAmiSSLTest.c
$ ls -la EmptyAmiSSLTest EmptyAmiSSLTest_O3 LocalBaseAmiSSLTest
-rwxr-xr-x 1 patrik access_bpf 56 4 Sep 00:19 EmptyAmiSSLTest*
-rwxr-xr-x 1 patrik access_bpf 56 4 Sep 00:19 EmptyAmiSSLTest_O3*
-rwxr-xr-x 1 patrik access_bpf 40 4 Sep 00:19 LocalBaseAmiSSLTest*
The https.c example included in AmiSSL builds with AMISSL_INLINE_H defined (and works), so I guess it is still functional enough for common use without those helper functions?
from amissl.
Sure. You'd get a linker error anyway if the code you are compiling actually needs those functions. IBrowse needs them for user certificate handling, for example, but for basic HTTPS they are not required.
from amissl.
Would it perhaps be sensible to make amissl/inline.h an opt-in include instead, as it is not needed in the general case and it gives these side-effects?
Apart from the unexpected behavior, the build time and memory consumption makes it impossible or very impractical to build on a real Amiga.
from amissl.
@patrikaxelsson I don't think so. I think we need to leave the maximum OpenSSL compatibility enabled by default.
I can compile IBrowse perfectly fine for OS3 with SAS/C on my A1200 and for OS4 with GCC on my A1XE, without needing to disable these headers (in fact, IBrowse needs some of those functions). AmiSSL itself is even buildable on my A1XE.
I shall keep this in mind with OpenSSL 3.0 though, which I am currently trying to port - at first glance, it seems they've made the safestack/lhash inline stuff even more complicated, but we shall see.
from amissl.
AMISSL_INLINE_H worked great as a workaround for this issue in 4.x, closing.
from amissl.
Related Issues (20)
- Cannot compile SDL example
- 64bit arguments passing with 68k .library ABI HOT 2
- openssl/asn1.h header redefinitions in Storm C 4 HOT 5
- Update installer to allow installation even while AmiSSL is in use HOT 8
- Optional installation of include? HOT 3
- Random generator init is very slow HOT 11
- OpenSSL speed output order issue when redirected HOT 15
- 68000 version missing HOT 7
- OpenSSL 3.0 / AmiSSL v5 HOT 8
- const const in header files HOT 2
- interfaces/amissl.h:4320:73: error: duplicate βconstβ HOT 1
- libamisslstubs.a missing a few stubs HOT 15
- AmiSSL version defines mismatches HOT 5
- Split Installer
- AMISSL_INLINE_H doesn't fully work with the 5.x SDK's HOT 12
- Big SSL/TLS connect performance regression in AmiSSL 5.x HOT 25
- FTPS stops working with ZitaFTP Server from version 5.4 HOT 13
- Example https Crashes on Vanilla AmigaOS v3.2 Installation on WinUAE HOT 3
- PatchWork Reports InitSemaphore "Structure Is Not Cleared" HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amissl.