Closed mouse07410 closed 6 years ago
@velichkov maybe you could shed some light? Here's the ASN.1 file:
Test2b DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
Test2b ::= SEQUENCE {
count INTEGER (40..20000),
data OCTET STRING (SIZE (40..20000))
}
END
(I'm sure you've seen it already ;).
For some reason, the current asn1c
does not include BIT_STRING_oer.c
in the set of copied files. I'm trying to figure out what part of the code was supposed to do that, but so far I'm pulling blanks. Could you help, perhaps?
Hi @mouse07410,
(I'm sure you've seen it already ;).
No, I haven't. Lately I've been busy with other projects.
For some reason, the current asn1c does not include BIT_STRING_oer.c in the set of copied files.
It does copy it when there is a BIT STRING type in the asn.
Test2b ::= SEQUENCE {
count INTEGER (40..20000),
data OCTET STRING (SIZE (40..20000)),
bits BIT STRING { a(1), b(2) }
}
So probably this is some kind of optimization.
I'm trying to figure out what part of the code was supposed to do that, but so far I'm pulling blanks
The code that generate the makefiles and copy skeleton files is in libasn1compiler/asn1c_save.c
I was able to reproduce the problem only when executing manually clang -maes -mpclmul -msse2 -mssse3 -msse4 ...
I'm able to compile and link using the generated converter-example.mk
. The difference is that it first generates a static archive libasncodec.a
and ten link the converter-example
with it.
ar rcs libasncodec.a Test2b.o OPEN_TYPE.o INTEGER.o NativeInteger.o constr_CHOICE.o constr_SEQUENCE.o asn_application.o asn_internal.o asn_random_fill.o asn_bit_data.o OCTET_STRING.o BIT_STRING.o asn_codecs_prim.o ber_tlv_length.o ber_tlv_tag.o ber_decoder.o der_encoder.o constr_TYPE.o constraints.o xer_support.o xer_decoder.o xer_encoder.o per_support.o per_decoder.o per_encoder.o per_opentype.o oer_decoder.o oer_encoder.o oer_support.o OPEN_TYPE_oer.o INTEGER_oer.o OCTET_STRING_oer.o NativeInteger_oer.o constr_CHOICE_oer.o constr_SEQUENCE_oer.o
cc -DPDU=Test2b -I. -o converter-example.o -c converter-example.c
cc -DPDU=Test2b -I. -o converter-example converter-example.o libasncodec.a -lm
@velichkov you saved my day (and not for the first time ;). Thank you!
Current master.
Problem
File
BIT_STRING_oer.c
is not included in the generatedMakefile.am.libasncodec
, and not copied to the target directory. Example:As a result, compilation fails:
Also, I tried to figure what component/file in the asn1c source code is responsible for copying the relevant skeleton files, but failed. Could you please point me at the relevant code?