How to create and initialize a GlobalVariable

I am new to LLVM APIs, I want to create and initialize a GlobalVariable with an arrary. I am able to create the GlobalVariable, but I cannot initialize it.
My code looks like this:

path = "../bitmap";;

std::vector<Constant *> fuzz_bitmap;
if (initcallfd.is_open()) {
     while (initcallfd >> cfi_mark) {
       Constant *ccfi_mark = ConstantInt::get(Int8Ty, cfi_mark, false);

   ArrayRef<Constant *> blockArray1(fuzz_bitmap);
   ArrayType *pArrTy1 = ArrayType::get(Int8Ty, fuzz_bitmap.size());
   Constant *blockItems1 = ConstantArray::get(pArrTy1, blockArray1);
   M.getOrInsertGlobal("__afl_area_ptr", blockItems1->getType());
   GlobalVariable* AFLMapPtr = M.getNamedGlobal("__afl_area_ptr");     

When this pass is used, fatal error is reported:

'common' global must have a zero initializer!
[65536 x i8]* @__afl_area_ptr
fatal error: error in backend: Broken module found, compilation aborted!
clang-12: error: clang frontend command failed with exit code 70 (use -v to see invocation)

When I changed the CommonLinkage as ExternalLinkage like this:


it still does not work, and report the following error:

.../AFL/afl-llvm-rt.o:../afl-llvm-rt.o.c:61: multiple definition of `__afl_area_ptr'
/tmp/vulnerable-3fe810.o:(.data+0x0): first defined here
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)

Can somebody help me out here?