Problem migrating libFLAC using Adobe Alchemy

I am trying to transfer a FLAC encoder using Adobe Alchemy for use in flash memory but cannot figure out where the problem is.
I am using Alchemy for Cygwin on Windows. It is correctly installed and configured.
The following are the steps that I followed for the FLAC port to encode:

  • Download the latest version of FLAC sources (1.2.1)
  • Configure FLAC sources ( ./configure --enable-static=true --enable-shared=false) with alchemy enabled ( alc-onbefore tuning)
  • Compile libFLAC with alchemy enabled ( makein the src / libFLAC folder)
  • Copy the header files and the compiled static library (libFLAC.a) to the alchemy folders ($ {ACLHEMY_HOME} / usr / local / include and $ {ACLHEMY_HOME} / usr / local / lib respectively)
  • Finally, compile SWC like this: or (whatever)
    gcc encodeflac.c -O3 -Wall -swc -lFLAC -o encodeflac.swc

    gcc encodeflac.c -O3 -Wall -swc -lFLAC -o encodeflac.swc

encodeflac.c is a modified version of the example, included in the FLAC sources (examples / c / encode / file / main.c) and adopted for working with ActionScript ByteArrays.

Swc will compile without warning or error. But the final swc size is only 85 KB, and the size of the static library (libFLAC.a) is about 1 MB! In addition, the encoding does not work. I get the following error when trying to use it in AS:
[Fault] exception, information=Undefined sym: FLAC_stream_encoder_new

Does this mean that the static library is not included in swc? Why?

Thanks in advance.

+3
source share
2 answers

Alchemy swc , . , , lib. :

  • gcc . -lFLAC (not -lflac)
  • FLAC.l.bc, libFLAC.a

, , :

Cannot yet select: 0x198b960: i32 = ConstantPool < i64 6881500230622117888> 0
0   llc                                 0x00636dfe _ZNSt8_Rb_treeIN4llvm3sys4PathES2_St9_IdentityIS2_ESt4lessIS2_ESaIS2_EE13insert_uniqueERKS2_ + 6078
1   llc                                 0x006373a2 _ZNSt8_Rb_treeIN4llvm3sys4PathES2_St9_IdentityIS2_ESt4lessIS2_ESaIS2_EE13insert_uniqueERKS2_ + 7522
2   libSystem.B.dylib                   0x9402f2bb _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   libSystem.B.dylib                   0x940a323a raise + 26
5   libSystem.B.dylib                   0x940af679 abort + 73
6   llc                                 0x002f862b _ZN98_GLOBAL__N__Volumes_data_dev_FlaCC_llvm_2.1_lib_Target_AVM2_AVM2ISelDAGToDAG.cpp_00000000_F04616B616AVM2DAGToDAGISel10SelectCodeEN4llvm9SDOperandE + 187
7   llc                                 0x002fa193 _ZN98_GLOBAL__N__Volumes_data_dev_FlaCC_llvm_2.1_lib_Target_AVM2_AVM2ISelDAGToDAG.cpp_00000000_F04616B616AVM2DAGToDAGISel10SelectRootEN4llvm9SDOperandE + 819
8   llc                                 0x002e6a2c _ZN4llvm19X86_64TargetMachineD0Ev + 65116
9   llc                                 0x003de4ca _ZN4llvm11StoreSDNodeD1Ev + 1610
10  llc                                 0x0040d3fe _ZN4llvm11StoreSDNodeD1Ev + 193918
11  llc                                 0x0040f92e _ZN4llvm11StoreSDNodeD1Ev + 203438
12  llc                                 0x005d1926 _ZN4llvm12FunctionPassD1Ev + 20998
13  llc                                 0x005d1f3a _ZN4llvm12FunctionPassD1Ev + 22554
14  llc                                 0x005d20c5 _ZN4llvm12FunctionPassD1Ev + 22949
15  llc                                 0x00002e44 _mh_execute_header + 7748
16  llc                                 0x00001f36 _mh_execute_header + 3894
17  ???                                 0x00000006 0x0 + 6

libFLAC (v1.2.1) ( ). , - C-, - LLVM, Alchemy. (, , LLVM .)

, , , ( !). , , - ffmpeg:   http://forums.adobe.com/message/2905914#2905914

+1

, 956 stream_encoder.c( 1.2.1):

encoder->private_->local_fixed_compute_best_predictor = FLAC__fixed_compute_best_predictor_wide

, , - . . , . , , ( 4096 16 ), , ...

: Flac, , , , SWAP_BE_WORD_TO_HOST bitwriter.c. - ntohl . , :

#define SWAP_BE_WORD_TO_HOST(x) (x<<24|(x&0x0000FF00)<<8|(x&0x00FF0000)>>8|x>>24)

, , Flac lib .

+1

All Articles